public InternalPortletPreference[] getStoredPreferences(PortletWindow plutoPortletWindow, PortletRequest portletRequest) throws PortletContainerException {
final HttpServletRequest httpServletRequest = this.portalRequestUtils.getOriginalPortletAdaptorRequest(portletRequest);
final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(httpServletRequest, plutoPortletWindow);
final IPortletEntity portletEntity = this.portletWindowRegistry.getParentPortletEntity(httpServletRequest, portletWindow.getPortletWindowId());
final IPortletDefinition portletDefinition = this.portletEntityRegistry.getParentPortletDefinition(portletEntity.getPortletEntityId());
final PortletDD portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinition.getPortletDefinitionId());
//Linked hash map used to add preferences in order loaded from the descriptor, definition and entity
final LinkedHashMap<String, InternalPortletPreference> preferencesMap = new LinkedHashMap<String, InternalPortletPreference>();
//Add descriptor preferences
final List<IPortletPreference> descriptorPreferencesList = this.getDescriptorPreferences(portletDescriptor);
this.addPreferencesToMap(descriptorPreferencesList, preferencesMap);
//Add definition preferences
final IPortletPreferences definitionPreferences = portletDefinition.getPortletPreferences();
final List<IPortletPreference> definitionPreferencesList = definitionPreferences.getPortletPreferences();
this.addPreferencesToMap(definitionPreferencesList, preferencesMap);
//Determine if the user is a guest
final boolean isGuest = isGuestUser(httpServletRequest);