@Override protected IPortletEntity getInitializationContext() { final HttpServletRequest containerRequest = this.portletRequestContext.getContainerRequest(); return this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); }
this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); final Lock portletEntityLock =
@Override protected IPortletEntity getInitializationContext() { final HttpServletRequest containerRequest = this.portletRequestContext.getContainerRequest(); return this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); }
this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); final Lock portletEntityLock =
@Override protected IPortletEntity getInitializationContext() { final HttpServletRequest containerRequest = this.portletRequestContext.getContainerRequest(); return this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); }
@Override protected IPortletEntity getInitializationContext() { final HttpServletRequest containerRequest = this.portletRequestContext.getContainerRequest(); return this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); }
@Override public Boolean doInTransaction(TransactionStatus status) { // Refresh the entity to avoid optimistic locking errors final IPortletEntity portletEntity = portletEntityRegistry.getPortletEntity( containerRequest, portletEntityId); final Map<String, IPortletPreference> targetPortletPreferences = getTargetPortletPreferences(); final Collection<IPortletPreference> values = targetPortletPreferences.values(); final boolean modified = portletEntity.setPortletPreferences( new ArrayList<IPortletPreference>(values)); if (!modified) { // Nothing actually changed, skip the store return Boolean.FALSE; } portletEntityRegistry.storePortletEntity( containerRequest, portletEntity); return Boolean.TRUE; } });
@Override public Boolean doInTransaction(TransactionStatus status) { // Refresh the entity to avoid optimistic locking errors final IPortletEntity portletEntity = portletEntityRegistry.getPortletEntity( containerRequest, portletEntityId); final Map<String, IPortletPreference> targetPortletPreferences = getTargetPortletPreferences(); final Collection<IPortletPreference> values = targetPortletPreferences.values(); final boolean modified = portletEntity.setPortletPreferences( new ArrayList<IPortletPreference>(values)); if (!modified) { // Nothing actually changed, skip the store return Boolean.FALSE; } portletEntityRegistry.storePortletEntity( containerRequest, portletEntity); return Boolean.TRUE; } });
@Override public PortletWindowIdImpl getPortletWindowId( HttpServletRequest request, String portletWindowId) { Validate.notNull(portletWindowId, "portletWindowId can not be null"); final String entityIdStr = PortletWindowIdStringUtils.parsePortletEntityId(portletWindowId); final String instanceId; if (!PortletEntityIdStringUtils.hasCorrectNumberOfParts(entityIdStr) || !PortletWindowIdStringUtils.hasCorrectNumberOfParts(portletWindowId)) { throw new IllegalArgumentException( "Provided portlet window ID '" + portletWindowId + "' is not valid"); } if (PortletWindowIdStringUtils.hasPortletWindowInstanceId(portletWindowId)) { instanceId = PortletWindowIdStringUtils.parsePortletWindowInstanceId(portletWindowId); } else { instanceId = null; } final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, entityIdStr); if (portletEntity == null) { throw new IllegalArgumentException( "No parent IPortletEntity found for id '" + entityIdStr + "' from portlet window id: " + portletWindowId); } return createPortletWindowId(instanceId, portletEntity.getPortletEntityId()); }
/** * Initializes a newly created {@link PortletWindow}, the default implementation sets up the * appropriate {@link WindowState} and {@link javax.portlet.PortletMode} */ protected void initializePortletWindowData( HttpServletRequest request, PortletWindowData portletWindowData) { final IStylesheetDescriptor stylesheetDescriptor = getThemeStylesheetDescriptor(request); final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId(); final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, portletEntityId); final WindowState entityWindowState = portletEntity.getWindowState(stylesheetDescriptor); if (persistentWindowStates.contains(entityWindowState)) { portletWindowData.setWindowState(entityWindowState); } else if (entityWindowState != null) { // Set of persistent window states must have changed, nuke the old value this.logger.warn( "PortletEntity.windowState=" + entityWindowState + " but that state is not in the set of persistent WindowStates. PortletEntity.windowState will be set to null"); portletEntity.setWindowState(stylesheetDescriptor, null); this.portletEntityRegistry.storePortletEntity(request, portletEntity); } }
@Override public PortletWindowIdImpl getPortletWindowId( HttpServletRequest request, String portletWindowId) { Validate.notNull(portletWindowId, "portletWindowId can not be null"); final String entityIdStr = PortletWindowIdStringUtils.parsePortletEntityId(portletWindowId); final String instanceId; if (!PortletEntityIdStringUtils.hasCorrectNumberOfParts(entityIdStr) || !PortletWindowIdStringUtils.hasCorrectNumberOfParts(portletWindowId)) { throw new IllegalArgumentException( "Provided portlet window ID '" + portletWindowId + "' is not valid"); } if (PortletWindowIdStringUtils.hasPortletWindowInstanceId(portletWindowId)) { instanceId = PortletWindowIdStringUtils.parsePortletWindowInstanceId(portletWindowId); } else { instanceId = null; } final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, entityIdStr); if (portletEntity == null) { throw new IllegalArgumentException( "No parent IPortletEntity found for id '" + entityIdStr + "' from portlet window id: " + portletWindowId); } return createPortletWindowId(instanceId, portletEntity.getPortletEntityId()); }
/** * Initializes a newly created {@link PortletWindow}, the default implementation sets up the * appropriate {@link WindowState} and {@link javax.portlet.PortletMode} */ protected void initializePortletWindowData( HttpServletRequest request, PortletWindowData portletWindowData) { final IStylesheetDescriptor stylesheetDescriptor = getThemeStylesheetDescriptor(request); final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId(); final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, portletEntityId); final WindowState entityWindowState = portletEntity.getWindowState(stylesheetDescriptor); if (persistentWindowStates.contains(entityWindowState)) { portletWindowData.setWindowState(entityWindowState); } else if (entityWindowState != null) { // Set of persistent window states must have changed, nuke the old value this.logger.warn( "PortletEntity.windowState=" + entityWindowState + " but that state is not in the set of persistent WindowStates. PortletEntity.windowState will be set to null"); portletEntity.setWindowState(stylesheetDescriptor, null); this.portletEntityRegistry.storePortletEntity(request, portletEntity); } }
protected IPortletWindow wrapPortletWindowData( HttpServletRequest request, PortletWindowData portletWindowData) { final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId(); final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, portletEntityId); if (portletEntity == null) { return null; } final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition(); final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor( portletDefinition.getPortletDefinitionId()); if (portletDescriptor == null) { return null; } final IPortletWindow portletWindow = new PortletWindowImpl(portletDescriptor, portletEntity, portletWindowData); logger.trace( "Wrapping PortletWindowData {} as IPortletWindow", portletWindow.getPortletWindowId()); return portletWindow; }
protected IPortletWindow wrapPortletWindowData( HttpServletRequest request, PortletWindowData portletWindowData) { final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId(); final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, portletEntityId); if (portletEntity == null) { return null; } final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition(); final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor( portletDefinition.getPortletDefinitionId()); if (portletDescriptor == null) { return null; } final IPortletWindow portletWindow = new PortletWindowImpl(portletDescriptor, portletEntity, portletWindowData); logger.trace( "Wrapping PortletWindowData {} as IPortletWindow", portletWindow.getPortletWindowId()); return portletWindow; }
this.portletEntityRegistry.getPortletEntity(request, portletEntityId); if (portletEntity == null) { throw new IllegalArgumentException(
this.portletEntityRegistry.getPortletEntity(request, portletEntityId); if (portletEntity == null) { throw new IllegalArgumentException(