protected PortletWindowIdImpl convertPortletWindowId( HttpServletRequest request, IPortletWindowId portletWindowId) { if (portletWindowId instanceof PortletWindowIdImpl) { return (PortletWindowIdImpl) portletWindowId; } return this.getPortletWindowId(request, portletWindowId.getStringId()); }
protected PortletWindowIdImpl convertPortletWindowId( HttpServletRequest request, IPortletWindowId portletWindowId) { if (portletWindowId instanceof PortletWindowIdImpl) { return (PortletWindowIdImpl) portletWindowId; } return this.getPortletWindowId(request, portletWindowId.getStringId()); }
protected String getAttributeName(IPortletWindow portletWindow, String property) { final String mappedAttributeName = this.propertyToAttributeMappings.get(property); final String attributeName; if (mappedAttributeName == null) { attributeName = property; } else { attributeName = mappedAttributeName; } if (this.nonNamespacedProperties.contains(property)) { return attributeName; } final IPortletWindowId portletWindowId = portletWindow.getPortletWindowId(); return portletWindowId.getStringId() + attributeName; }
protected String getAttributeName(IPortletWindow portletWindow, String property) { final String mappedAttributeName = this.propertyToAttributeMappings.get(property); final String attributeName; if (mappedAttributeName == null) { attributeName = property; } else { attributeName = mappedAttributeName; } if (this.nonNamespacedProperties.contains(property)) { return attributeName; } final IPortletWindowId portletWindowId = portletWindow.getPortletWindowId(); return portletWindowId.getStringId() + attributeName; }
protected StartElement addPortletWindowId( StartElement element, IPortletWindowId portletWindowId) { final Attribute windowIdAttribute = xmlEventFactory.createAttribute( PORTLET_WINDOW_ID_ATTR_NAME, portletWindowId.getStringId()); // Clone the start element to add the new attribute final QName name = element.getName(); final String prefix = name.getPrefix(); final String namespaceURI = name.getNamespaceURI(); final String localPart = name.getLocalPart(); @SuppressWarnings("unchecked") final Iterator<Attribute> attributes = element.getAttributes(); @SuppressWarnings("unchecked") final Iterator<Namespace> namespaces = element.getNamespaces(); final NamespaceContext namespaceContext = element.getNamespaceContext(); // Create a new iterator of the existing attributes + the new window id attribute final Iterator<Attribute> newAttributes = Iterators.concat(attributes, Iterators.forArray(windowIdAttribute)); return xmlEventFactory.createStartElement( prefix, namespaceURI, localPart, newAttributes, namespaces, namespaceContext); }
protected StartElement addPortletWindowId( StartElement element, IPortletWindowId portletWindowId) { final Attribute windowIdAttribute = xmlEventFactory.createAttribute( PORTLET_WINDOW_ID_ATTR_NAME, portletWindowId.getStringId()); // Clone the start element to add the new attribute final QName name = element.getName(); final String prefix = name.getPrefix(); final String namespaceURI = name.getNamespaceURI(); final String localPart = name.getLocalPart(); @SuppressWarnings("unchecked") final Iterator<Attribute> attributes = element.getAttributes(); @SuppressWarnings("unchecked") final Iterator<Namespace> namespaces = element.getNamespaces(); final NamespaceContext namespaceContext = element.getNamespaceContext(); // Create a new iterator of the existing attributes + the new window id attribute final Iterator<Attribute> newAttributes = Iterators.concat(attributes, Iterators.forArray(windowIdAttribute)); return xmlEventFactory.createStartElement( prefix, namespaceURI, localPart, newAttributes, namespaces, namespaceContext); }
@Override public <P extends Populator<String, String>> void populateRequestProperties( HttpServletRequest portletRequest, IPortletWindow portletWindow, P propertiesPopulator) { if (this.propertyToAttributeMappings.isEmpty() && this.nonNamespacedProperties.isEmpty()) { return; } final HttpServletRequest portalRequest = this.portalRequestUtils.getOriginalPortalRequest(portletRequest); final String windowIdStr = portletWindow.getPortletWindowId().getStringId(); for (@SuppressWarnings("unchecked") final Enumeration<String> attributeNames = portalRequest.getAttributeNames(); attributeNames.hasMoreElements(); ) { final String fullAttributeName = attributeNames.nextElement(); final String propertyName = getPropertyName(windowIdStr, fullAttributeName); if (propertyName == null) { continue; } logger.debug( "Found portal request attribute {} returning as property {}", fullAttributeName, propertyName); final Object value = portalRequest.getAttribute(fullAttributeName); convertValue(propertyName, value, propertiesPopulator); } }
@Override public <P extends Populator<String, String>> void populateRequestProperties( HttpServletRequest portletRequest, IPortletWindow portletWindow, P propertiesPopulator) { if (this.propertyToAttributeMappings.isEmpty() && this.nonNamespacedProperties.isEmpty()) { return; } final HttpServletRequest portalRequest = this.portalRequestUtils.getOriginalPortalRequest(portletRequest); final String windowIdStr = portletWindow.getPortletWindowId().getStringId(); for (@SuppressWarnings("unchecked") final Enumeration<String> attributeNames = portalRequest.getAttributeNames(); attributeNames.hasMoreElements(); ) { final String fullAttributeName = attributeNames.nextElement(); final String propertyName = getPropertyName(windowIdStr, fullAttributeName); if (propertyName == null) { continue; } logger.debug( "Found portal request attribute {} returning as property {}", fullAttributeName, propertyName); final Object value = portalRequest.getAttribute(fullAttributeName); convertValue(propertyName, value, propertiesPopulator); } }
final String eventKey = portletWindowId != null ? portletWindowId.getStringId() : portletRenderEvent.getFname(); renderEvents.put(eventKey, portletRenderEvent);
@Before public void setup() throws Exception { MockitoAnnotations.initMocks(this); portletWindowCache = new PortletWindowCache(); when(portletEntityId.getStringId()).thenReturn("110_u18l1n1203_60"); when(portletWindowId.getStringId()).thenReturn("210_u18l1n1203_80"); when(portletWindowDescriptor.getPortletEntityId()).thenReturn(portletEntityId); when(portletWindowDescriptor.getPortletWindowId()).thenReturn(portletWindowId); }
url.addParameter( PARAM_DELEGATE_PARENT + prefixedPortletWindowId, delegationParentId.getStringId()); addedNonTargetedPortletParam = true;
url.addParameter( PARAM_DELEGATE_PARENT + prefixedPortletWindowId, delegationParentId.getStringId()); addedNonTargetedPortletParam = true;
final String basePortletWindowIdStr = basePortletWindowId.getStringId(); basePortletWindowId = this.getPortletWindowId(request, basePortletWindowIdStr);
final String basePortletWindowIdStr = basePortletWindowId.getStringId(); basePortletWindowId = this.getPortletWindowId(request, basePortletWindowIdStr);