Refine search
public DefaultFriendlyURLMapper() { defaultIgnoredParameters = new LinkedHashSet<>(); defaultIgnoredParameters.add("p_p_id"); defaultReservedParameters = new LinkedHashMap<>(); defaultReservedParameters.put("p_p_lifecycle", "0"); defaultReservedParameters.put( "p_p_state", WindowState.NORMAL.toString()); defaultReservedParameters.put("p_p_mode", PortletMode.VIEW.toString()); }
WindowState state = request.getWindowState(); if (!state.equals(WindowState.MINIMIZED)) { PortletMode mode = request.getPortletMode(); Method renderMethod = renderModeHandlingMethodsMap.get(mode.toString()); if (renderMethod != null) { renderMethod.invoke(this, request, response); if (mode.equals(PortletMode.VIEW)) { doView(request, response); } else if (mode.equals(PortletMode.EDIT)) { doEdit(request, response); } else if (mode.equals(PortletMode.HELP)) { doHelp(request, response); } else {
public static PortletMode getPortletMode( String name, int portletMajorVersion) { if (Validator.isNull(name)) { if (portletMajorVersion < 3) { return PortletMode.VIEW; } return PortletMode.UNDEFINED; } PortletMode portletMode = _portletModes.get(name); if (portletMode == null) { portletMode = new PortletMode(name); } return portletMode; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PortletState that = (PortletState) o; if (action != that.action) return false; if (secure != that.secure) return false; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (parameters != null ? !parameters.equals(that.parameters) : that.parameters != null) return false; if (portletMode != null ? !portletMode.equals(that.portletMode) : that.portletMode != null) return false; if (windowState != null ? !windowState.equals(that.windowState) : that.windowState != null) return false; return true; }
public void setPortletMode(PortletMode portletMode) { this.portletMode = portletMode; this.modeName = portletMode == null ? null : portletMode.toString(); }
/** * Construct a PortletMode object given a mode string. */ private PortletMode createPortletMode(String mode) { if (PortletMode.VIEW.toString().equalsIgnoreCase(mode)) { return PortletMode.VIEW; } else if (PortletMode.EDIT.toString().equalsIgnoreCase(mode)) { return PortletMode.EDIT; } else if (PortletMode.HELP.toString().equalsIgnoreCase(mode)) { return PortletMode.HELP; } else { return new PortletMode(mode); } } }
public void processAction (ActionRequest request, ActionResponse response) throws PortletException, IOException { String mode = request.getParameter("mode"); PortletMode currentMode = ( mode != null ) ? new PortletMode(mode) : request.getPortletMode(); if ( PortletMode.VIEW.equals(currentMode) ) { processViewAction(request,response); } else if ( PortletMode.EDIT.equals(currentMode) ) { processEditAction(request,response); } else if ( PortletMode.HELP.equals(currentMode) ) { processHelpAction(request,response); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { id = in.readObject().toString(); action = in.readBoolean(); secure = in.readBoolean(); parameters = (Map) in.readObject(); portletMode = new PortletMode(in.readObject().toString()); windowState = new WindowState(in.readObject().toString()); if (LOG.isDebugEnabled()) { LOG.debug("Deserializing PortletState [action=" + action + "]"); } } }
@Override public int hashCode() { int result; result = (id != null ? id.hashCode() : 0); result = 31 * result + (action ? 1 : 0); result = 31 * result + (secure ? 1 : 0); result = 31 * result + (parameters != null ? parameters.hashCode() : 0); result = 31 * result + (portletMode != null ? portletMode.hashCode() : 0); result = 31 * result + (windowState != null ? windowState.hashCode() : 0); return result; }
@Override public int hashCode() { return (this.mode.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.parameter)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; DelegationRequest other = (DelegationRequest) obj; if (this.delegateState == null) { if (other.delegateState != null) return false; } else if (!this.delegateState.equals(other.delegateState)) return false; if (this.parentParameters == null) { if (other.parentParameters != null) return false; } else if (!this.parentParameters.equals(other.parentParameters)) return false; if (this.parentPortletMode == null) { if (other.parentPortletMode != null) return false; } else if (!this.parentPortletMode.equals(other.parentPortletMode)) return false; if (this.parentWindowState == null) { if (other.parentWindowState != null) return false; } else if (!this.parentWindowState.equals(other.parentWindowState)) return false; return true; } /* (non-Javadoc)
/** * @see org.hibernate.usertype.UserType#disassemble(java.lang.Object) */ public Serializable disassemble(Object value) throws HibernateException { final PortletMode mode = (PortletMode)value; return mode.toString(); }
private boolean isPortletModeSupported(PortletMode requestedPortletMode,IPortletWindow referencedPortletWindow) { // PLT 8.1: View Portlet Mode should always be supported by a portlet, even if not defined in the descriptor if (requestedPortletMode.equals(PortletMode.VIEW) || requestedPortletMode.toString().equalsIgnoreCase("view")) { return true; } IPortletDefinition portletDefinition = referencedPortletWindow.getPortletEntity().getPortletDefinition(); Map<String,IContentType> contentTypes = portletDefinition.getSupportedContentTypes(); for(IContentType type: contentTypes.values()) { Set<PortletMode> modeSet=type.getPortletModeSet(); if(modeSet.contains(requestedPortletMode)) { return true; } } return false; }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof PortletModeParameterLookupKey)) { return false; } PortletModeParameterLookupKey otherKey = (PortletModeParameterLookupKey) other; return (this.mode.equals(otherKey.mode) && ObjectUtils.nullSafeEquals(this.parameter, otherKey.parameter)); }
/** * Creates a <code>PortletMode</code> object based on the specified name. * * @param portletModeName the name of the portlet mode * @return one of the standard PortletModes if the specified name matches one of them or a new PortletMode. * @see javax.portlet.PortletMode */ public static PortletMode decodePortletMode(String portletModeName) { if (PortletMode.EDIT.toString().equalsIgnoreCase(portletModeName)) { return PortletMode.EDIT; } else if (PortletMode.HELP.toString().equalsIgnoreCase(portletModeName)) { return PortletMode.HELP; } else if (PortletMode.VIEW.toString().equalsIgnoreCase(portletModeName)) { return PortletMode.VIEW; } else { return new PortletMode(portletModeName); } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((portletMode == null) ? 0 : portletMode.hashCode()); result = prime * result + ((redirectLocation == null) ? 0 : redirectLocation.hashCode()); result = prime * result + ((renderParameters == null) ? 0 : renderParameters.hashCode()); result = prime * result + ((renderUrlParamName == null) ? 0 : renderUrlParamName.hashCode()); result = prime * result + ((windowState == null) ? 0 : windowState.hashCode()); return result; }
@Override public int hashCode() { return (this.mode.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.parameter)); }