@Override public IPortletWindow getOrCreateDefaultPortletWindowByFname( HttpServletRequest request, String fname) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(fname, "fname cannot be null"); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntityByFname( request, userInstance, fname); if (portletEntity == null) { return null; } final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntity.getPortletEntityId()); logger.trace( "Found portlet window {} for portlet definition fname {}", portletWindow, fname); return portletWindow; }
@Override public IPortletWindow getOrCreateDefaultPortletWindow( HttpServletRequest request, IPortletDefinitionId portletDefinitionId) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(portletDefinitionId, "portletDefinition cannot be null"); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreateDefaultPortletEntity( request, portletDefinitionId); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); return this.getOrCreateDefaultPortletWindow(request, portletEntityId); }
@Override public IPortletWindow getOrCreateDefaultPortletWindowByLayoutNodeId( HttpServletRequest request, String subscribeId) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(subscribeId, "subscribeId cannot be null"); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntity( request, userInstance, subscribeId); if (portletEntity == null) { logger.debug( "No portlet entity found for id {}, no IPortletWindow will be returned.", subscribeId); return null; } logger.trace("Found portlet entity {} for id {}", portletEntity, subscribeId); final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntity.getPortletEntityId()); logger.trace("Found portlet window {} for layout node {}", portletWindow, subscribeId); return portletWindow; }
@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; } });
this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); final Lock portletEntityLock = this.portletEntityRegistry.getPortletEntityLock(containerRequest, portletEntityId);
if (portletEntity == null) { portletEntity = this.portletEntityRegistry.getOrCreatePortletEntity( request, userInstance, layoutNodeId); this.portletEntityRegistry.getOrCreateDefaultPortletEntity( request, portletDefinitionId); if (defaultPortletEntity.equals(portletEntity)) { this.portletEntityRegistry.getOrCreateDefaultPortletEntity( request, portletDefinitionId); final IPortletEntityId portletEntityId =
@Override protected IPortletEntity getInitializationContext() { final HttpServletRequest containerRequest = this.portletRequestContext.getContainerRequest(); return this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); }
this.portletEntityRegistry.storePortletEntity(request, portletEntity);
@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 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 = this.portletEntityRegistry.getPortletEntityLock(containerRequest, portletEntityId);
this.portletEntityRegistry.storePortletEntity(request, portletEntity);
@Override public IPortletWindow getOrCreateDefaultPortletWindowByFname( HttpServletRequest request, String fname) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(fname, "fname cannot be null"); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntityByFname( request, userInstance, fname); if (portletEntity == null) { return null; } final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntity.getPortletEntityId()); logger.trace( "Found portlet window {} for portlet definition fname {}", portletWindow, fname); return portletWindow; }
/** * 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 IPortletWindow getOrCreateDefaultPortletWindowByLayoutNodeId( HttpServletRequest request, String subscribeId) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(subscribeId, "subscribeId cannot be null"); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntity( request, userInstance, subscribeId); if (portletEntity == null) { logger.debug( "No portlet entity found for id {}, no IPortletWindow will be returned.", subscribeId); return null; } logger.trace("Found portlet entity {} for id {}", portletEntity, subscribeId); final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntity.getPortletEntityId()); logger.trace("Found portlet window {} for layout node {}", portletWindow, subscribeId); return portletWindow; }
@Override protected IPortletEntity getInitializationContext() { final HttpServletRequest containerRequest = this.portletRequestContext.getContainerRequest(); return this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); }
@Override public IPortletWindow getOrCreateDefaultPortletWindow( HttpServletRequest request, IPortletDefinitionId portletDefinitionId) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(portletDefinitionId, "portletDefinition cannot be null"); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreateDefaultPortletEntity( request, portletDefinitionId); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); return this.getOrCreateDefaultPortletWindow(request, portletEntityId); }
fname = folderName; portletEntity = this.portletEntityRegistry.getOrCreatePortletEntityByFname( request, userInstance, fname); } else { this.portletEntityRegistry.getOrCreatePortletEntityByFname( request, userInstance, fname, subscribeId);
/** * 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); } }
this.portletEntityRegistry.getOrCreatePortletEntity( request, userInstance, channelSubscribeId); if (portletEntity == null) {