public void removeApplication(PortletApplication app) throws RegistryException { getPersistenceBrokerTemplate().delete(app); this.preferenceService.removeDefaults(app); }
public void removeUser(String username) throws SecurityException { if (username != null && username.equals(getAnonymousUser())) { throw new SecurityException(SecurityException.ANONYMOUS_USER_PROTECTED.create(username)); } JetspeedPrincipal user; user = getUser(username); super.removePrincipal(user); // Since 2.3.0 PortletPreferencesProvider provider = getPreferencesProvider(); if (provider != null) { provider.removeUserPreferences(username); } }
public void sessionCreated(HttpSessionEvent se) { PortletServices services = JetspeedPortletServices.getSingleton(); if (services != null) { PortalSessionsManager psm = (PortalSessionsManager)services.getService(PortalSessionsManager.SERVICE_NAME); if (psm != null) { psm.portalSessionCreated(se.getSession()); } } PortletPreferencesProvider preferencesProvider = engine.getComponentManager().lookupComponent("portletPreferencesProvider"); if (preferencesProvider != null) { preferencesProvider.sessionCreatedEvent(se.getSession()); } }
jsEntity.setId(windowId); JSEntityPreferences entityPreferences = new JSEntityPreferences(); Set<String> userNames = prefsProvider.getUserNames(definition, windowId); for (String userName : userNames) Map<String, PortletPreference> userPreferences = prefsProvider.getUserPreferences(definition, windowId, userName); JSEntityPreference userPreference = new JSEntityPreference(); userPreference.setPrincapalName(userName);
public void registerPortletApplication(PortletApplication newApp) throws RegistryException { getPersistenceBrokerTemplate().store(newApp); this.preferenceService.storeDefaults(newApp); this.restoreClones(newApp); }
public void sessionDestroyed(HttpSessionEvent se) { Subject subject = (Subject)se.getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT); if (subject == null) return; if (firstInit) { // Servlet already destroyed, // Can't reliably access ComponentManager (Spring) anymore // as for instance WAS 6.0.2 has a bug invoking this method with a wrong classLoader (not the one for the WebApp) return; } Principal subjectUserPrincipal = SubjectHelper.getPrincipal(subject, UserSubjectPrincipal.class); PortalStatistics statistics = engine.getComponentManager().lookupComponent("PortalStatistics"); long sessionLength = System.currentTimeMillis() - se.getSession().getCreationTime(); String ipAddress = (String)se.getSession().getAttribute(SecurityValve.IP_ADDRESS); statistics.logUserLogout(ipAddress, subjectUserPrincipal.getName(), sessionLength); UserContentCacheManager userContentCacheManager = engine.getComponentManager().lookupComponent("userContentCacheManager"); userContentCacheManager.evictUserContentCache(subjectUserPrincipal.getName(), se.getSession().getId()); // clear preferences cache PortletPreferencesProvider preferencesProvider = engine.getComponentManager().lookupComponent("portletPreferencesProvider"); if (preferencesProvider != null) { preferencesProvider.sessionDestroyedEvent(se.getSession()); } }
private JSPortlet exportPD(PortletDefinition pd, Map<String,Object> settings, Logger log) throws SerializerException { JSPortlet jsPortlet = null; try { Set<String> windowIds = prefsProvider.getPortletWindowIds(pd); if ((windowIds == null) || (windowIds.size() == 0)) return null; JSEntities entities = new JSEntities(); for (String windowId : windowIds) { JSEntity jsEntity = exportEntityPref(pd, windowId, settings, log); if (jsEntity != null) entities.add(jsEntity); } if (!entities.isEmpty()) { jsPortlet = new JSPortlet(); jsPortlet.setName(pd.getPortletName()); jsPortlet.setEntities(entities); log.debug("-----exporting for PD=" + pd.getPortletName()); // jsPortlet.setEntities(entities); } } catch (Exception e) { throw new SerializerException(SerializerException.CREATE_SERIALIZED_OBJECT_FAILED.create(new String[] { "Entity", e.getMessage() }), e); } return jsPortlet; }
public Preferences getPortletPreferences() { if (PortletDefinitionImpl.portletPreferencesProvider == null) { return new PreferencesImpl(); } Map<String, PortletPreference> prefMap = PortletDefinitionImpl.portletPreferencesProvider.retrieveDefaultPreferences(this); Preferences preferences = new PreferencesImpl(); List<Preference> list = preferences.getPortletPreferences(); for (PortletPreference pref : prefMap.values()) { Preference p = preferences.addPreference(pref.getName()); p.setReadOnly(pref.isReadOnly()); String [] values = pref.getValues(); if (values != null) { for (String s : values) { p.addValue(s); } } } return preferences; }
prefsProvider.storePortletPreference(pd, entity.getId(), userName, portletPreference); prefsProvider.storePortletPreference(app.getName(), portlet.getName(), entity.getId(), userName, portletPreference);
preferenceService.storeDefaults(copy, (Preferences)null);