protected IUserProfile getUserProfile( HttpServletRequest request, IPerson person, LocaleManager localeManager, String userAgent) { final String profileFname = profileMapper.getProfileFname(person, request); IUserProfile userProfile = userLayoutStore.getUserProfileByFname(person, profileFname); if (userProfile == null) { userProfile = userLayoutStore.getSystemProfileByFname(profileFname); } if (localeManager != null && localeManagerFactory.isLocaleAware()) { userProfile.setLocaleManager(localeManager); } return userProfile; }
LOG.debug("Load from store for " + owner.getUserName()); userLayout = this.distributedLayoutStore.getUserLayout(this.owner, this.profile);
@Override protected Element exportDataElement(String userName) { final Integer userId = this.userIdentityStore.getPortalUserId(userName); if (userId == null) { this.logger.warn("No user " + userName + " found, no layout will be exported"); return null; } // Setup empty IPerson used to interact with the layout store final PersonImpl person = new PersonImpl(); person.setUserName(userName); person.setID(userId); person.setSecurityContext(new BrokenSecurityContext()); try { this.userLayoutStore.setProfileImportExportCache(layoutCache); this.userLayoutStore.setLayoutImportExportCache(profileCache); final IUserProfile userProfile = userLayoutStore.getUserProfileByFname( person, UserProfile.DEFAULT_PROFILE_FNAME); final Element layoutElement = userLayoutStore.exportLayout(person, userProfile); return layoutElement; } finally { this.userLayoutStore.setProfileImportExportCache(null); this.userLayoutStore.setLayoutImportExportCache(null); } } }
if (!plfNode.getAttribute(Constants.ATT_CHANNEL_ID) .equals("")) // dealing with a channel plfID = uls.generateNewChannelSubscribeId(person); else plfID = uls.generateNewFolderId(person); } catch (Exception e) { throw new PortalException(
IUserProfile profile = userLayoutStore.getUserProfileByFname(owner, "default"); final LocaleManager localeManager = localeManagerFactory.createLocaleManager( profile = userLayoutStore.getSystemProfileByFname(profile.getProfileFname()); layout = userLayoutStore.getFragmentLayout(owner, profile); Element root = layout.getDocumentElement(); root.setAttribute(
/** * Provides a {@link Tuple} containing the "fragmentized" version of a DLM fragment * owner's layout, together with the username. This version of the layout consistent with what * DLM uses internally for fragments, and is created by FragmentActivator.fragmentizeLayout. * It's important that the version returned by this method matches what DLM uses internally * because it will be used to establish relationships between fragment layout nodes and user * customizations of DLM fragments. * * @param userId * @return */ /* TODO: make private */ Tuple<String, DistributedUserLayout> getUserLayoutTuple( String userName, int userId) { final PersonImpl person = new PersonImpl(); person.setUserName(userName); person.setID(userId); person.setSecurityContext(new BrokenSecurityContext()); final IUserProfile profile = layoutStore.getUserProfileByFname(person, UserProfile.DEFAULT_PROFILE_FNAME); final DistributedUserLayout userLayout = layoutStore.getUserLayout(person, (UserProfile) profile); return new Tuple<String, DistributedUserLayout>(userName, userLayout); } }
private IStylesheetDescriptor getCurrentUserProfileStyleSheetDescriptor( IPerson person, HttpServletRequest currentPortalRequest) { final String currentFname = profileMapper.getProfileFname(person, currentPortalRequest); IUserProfile profile = userLayoutStore.getSystemProfileByFname(currentFname); int profileId = profile.getThemeStylesheetId(); return stylesheetDescriptorDao.getStylesheetDescriptor(profileId); }
/** * @param personAttributes * @see * org.apereo.portal.layout.IUserLayoutHelper#resetUserLayout(org.apereo.services.persondir.IPersonAttributes) */ @BasePortalJpaDao.PortalTransactional @Override public void resetUserLayout(final IPersonAttributes personAttributes) { // Create an empty RestrictedPerson object final IPerson person = PersonFactory.createRestrictedPerson(); // populate the person with the supplied attributes person.setAttributes(personAttributes.getAttributes()); // get the integer uid into the person object without creating any new person data final int uid = userIdentityStore.getPortalUID(person, false); person.setID(uid); final IUserProfile profile = userLayoutStore.getUserProfileByFname(person, DEFAULT_LAYOUT_FNAME); resetUserLayoutForProfileByName(person, profile); resetStylesheetUserPreferencesForProfile(person, profile); }
if (userLayoutStore != null) { try { fragmentLayoutMap = userLayoutStore.getFragmentLayoutCopies(); } catch (Exception e) { String msg = "Failed to access fragment layouts";
fragChanInf = this.distributedLayoutStore.getFragmentChannelInfo(nodeId); Map oldParms = new HashMap(oldChanDesc.getParameterMap()); for (Iterator itr = newChanDesc.getParameterMap().entrySet().iterator(); itr.hasNext(); ) {
private IStylesheetDescriptor getCurrentUserProfileStyleSheetDescriptor( IPerson person, HttpServletRequest currentPortalRequest) { final String currentFname = profileMapper.getProfileFname(person, currentPortalRequest); IUserProfile profile = userLayoutStore.getSystemProfileByFname(currentFname); int profileId = profile.getThemeStylesheetId(); return stylesheetDescriptorDao.getStylesheetDescriptor(profileId); }
if (node instanceof IUserLayoutChannelDescription) { isChannel = true; node.setId(this.distributedLayoutStore.generateNewChannelSubscribeId(owner)); } else { node.setId(this.distributedLayoutStore.generateNewFolderId(owner));
@ResourceMapping("layoutInfo") public String getLayoutInfo( ResourceRequest request, @RequestParam String portletFName, Model model) throws TransformerException { Validate.notNull(portletFName, "Please supply a portlet fname"); final HttpServletRequest servletRequest = this.portalRequestUtils.getPortletHttpRequest(request); IUserInstance ui = userInstanceManager.getUserInstance(servletRequest); UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager(); IUserLayoutManager ulm = upm.getUserLayoutManager(); IPerson person = ui.getPerson(); DistributedUserLayout userLayout = userLayoutStore.getUserLayout(person, upm.getUserProfile()); List<PortletTab> tabs = getPortletTabInfo(userLayout, portletFName); boolean isFavorite = isPortletFavorited(ulm.getUserLayout(), portletFName); model.addAttribute("favorite", isFavorite); model.addAttribute("tabs", tabs); return "json"; }
final DistributedUserLayout userLayout = userLayoutStore.getUserLayout(person, profile); Document document = userLayout.getLayout();