LOG.debug("Load from store for " + owner.getUserName()); userLayout = this.distributedLayoutStore.getUserLayout(this.owner, this.profile);
@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();
/** * 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); } }