@Override public void destroy() { super.destroy(); getService().destroy(); }
doHeaders(request, response); Collection<PortletMode> nextModes = getNextPossiblePortletModes(request); if (nextModes != null) response.setNextPossiblePortletModes(nextModes); response.setTitle(getTitle(request)); } else if (renderPartAttrValue.equals(RenderRequest.RENDER_MARKUP)) { doDispatch(request, response); } else { throw new PortletException("Unknown value of the 'javax.portlet.render_part' request attribute"); doHeaders(request, response); Collection<PortletMode> nextModes = getNextPossiblePortletModes(request); if (nextModes != null) response.setNextPossiblePortletModes(nextModes); response.setTitle(getTitle(request)); doDispatch(request, response);
/** * Default resource serving. * <p> * The default implementation of this method does nothing. * <p> * However, if the reserved portlet initialization parameter * {@link #AUTOMATIC_RESOURCE_DISPATCH} * (= "javax.portlet.automaticResourceDispatching") * is set to <code>true</code>, the default * implementation will perform a * <code>PortletRequestDispatcher.forward</code> to the location designated by * the ResourceID of the ResourceRequest. * If no ResourceID is set on the resource URL the default implementation * does nothing. * * @since 2.0 */ public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { String autofwd = getInitParameter(AUTOMATIC_RESOURCE_DISPATCH); if (autofwd != null && autofwd.equalsIgnoreCase("true")) { if (request.getResourceID() != null) { PortletRequestDispatcher rd = getPortletConfig().getPortletContext().getRequestDispatcher( request.getResourceID()); if (rd != null) rd.forward(request, response); } } }
@Override public void init() throws PortletException { super.init(); addProcessActionSuccessMessage = GetterUtil.getBoolean( getInitParameter("add-process-action-success-action"), true); alwaysSendRedirect = GetterUtil.getBoolean( getInitParameter("always-send-redirect")); }
/** * @return The Portlet instance defined by dicon file * @throws PortletException */ protected GenericPortlet getGenericPortlet() throws PortletException { GenericPortlet portlet = (GenericPortlet) SingletonS2ContainerFactory .getContainer().getComponent(portletName); if (portlet == null) { throw new PortletException("GenericPortlet is not defined in " + config.getInitParameter(CONFIG_PATH_KEY) + "."); } // Initialize portlet instance if (portlet.getPortletConfig() == null) { portlet.init(config); } return portlet; }
@Override protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException { try { // try to let super handle - it'll call methods annotated for // handling, the default doXYZ(), or throw if a handler for the mode // is not found super.doDispatch(request, response); } catch (PortletException e) { if (e.getCause() == null) { // No cause interpreted as 'unknown mode' - pass that trough // so that the application can handle handleRequest(request, response); } else { // Something else failed, pass on throw e; } } }
/** * The default implementation of this method sets the title * using the <code>getTitle</code> method and invokes the * <code>doDispatch</code> method. * * @param request * the render request * @param response * the render response * * @exception PortletException * if the portlet cannot fulfilling the request * @exception UnavailableException * if the portlet is unavailable to perform render at this time * @exception PortletSecurityException * if the portlet cannot fullfill this request because of security reasons * @exception java.io.IOException * if the streaming causes an I/O problem * */ public void render (RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException { response.setTitle(getTitle(request)); doDispatch(request, response); }
JetspeedPortletConfig config = (JetspeedPortletConfig) portlet.getPortletConfig(); PortletDefinition portletDef = config.getPortletDefinition(); this.supports = portletDef.getSupports();
@Override protected String getTitle(RenderRequest renderRequest) { try { return PortalUtil.getPortletTitle(renderRequest); } catch (Exception e) { return super.getTitle(renderRequest); } }
protected void doEdit(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { super.doEdit(renderRequest, renderResponse); }
@Override public void init(PortletConfig config) throws PortletException { CurrentInstance.clearAll(); super.init(config); Properties initParameters = new Properties();
/** * If mode is VIEW, EDIT, or HELP -- defer to the doView, doEdit, doHelp so subclasses can * override. Otherwise handle mode here if there is a defaultViewId mapping for it. */ @Override public void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException { // Defer to helper methods for standard modes so subclasses can override PortletMode mode = request.getPortletMode(); if (mode.equals(PortletMode.EDIT) || mode.equals(PortletMode.HELP) || mode.equals(PortletMode.VIEW)) { super.doDispatch(request, response); } else { // Bridge didn't process this one -- so forge ahead if (!doRenderDispatchInternal(request, response)) { super.doDispatch(request, response); } } }
/** * Default resource serving. * <p> * The default implementation of this method does nothing. * <p> * However, if the reserved portlet initialization parameter * {@link #AUTOMATIC_RESOURCE_DISPATCH} * (= "javax.portlet.automaticResourceDispatching") * is set to <code>true</code>, the default * implementation will perform a * <code>PortletRequestDispatcher.forward</code> to the location designated by * the ResourceID of the ResourceRequest. * If no ResourceID is set on the resource URL the default implementation * does nothing. * * @since 2.0 */ public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { String autofwd = getInitParameter(AUTOMATIC_RESOURCE_DISPATCH); if (autofwd != null && autofwd.equalsIgnoreCase("true")) { if (request.getResourceID() != null) { PortletRequestDispatcher rd = getPortletConfig().getPortletContext().getRequestDispatcher( request.getResourceID()); if (rd != null) rd.forward(request, response); } } }
String title = genericPortlet.getPortletConfig().getResourceBundle(request.getLocale()).getString("javax.portlet.title"); response.setTitle(title);
/** * Called when the portlet is initialized. * * @param config The standard portlet configuration data * structure for any Portlet */ public void init(PortletConfig config) throws PortletException { super.init(config); }
@Override public void destroy() { super.destroy(); }