use of org.apereo.portal.security.IPerson in project uPortal by Jasig.
the class PAGSTest method testStringEqualsIgnoreCaseTester.
public void testStringEqualsIgnoreCaseTester() throws Exception {
print(CR + "***** ENTERING PAGSTester.testStringEqualsIgnoreCaseTester() *****" + CR);
String msg = null;
msg = "Creating a new IPerson";
print(msg);
IPerson newPerson = getIPerson("de3");
assertNotNull(msg, newPerson);
print("Adding attributes to IPerson.");
newPerson.setAttribute(key1, randomStrings[0]);
newPerson.setAttribute(key2, randomStrings[1].toLowerCase());
msg = "Testing IPerson " + newPerson;
print(msg);
String testKey = randomStrings[0].toLowerCase();
IPersonTester tester1 = new StringEqualsIgnoreCaseTester(new TestPersonAttributesGroupTestDefinition(key1, testKey));
IPersonTester tester2 = new StringEqualsIgnoreCaseTester(new TestPersonAttributesGroupTestDefinition(key2, randomStrings[1]));
msg = "Testing " + tester1;
assertTrue(msg, tester1.test(newPerson));
msg = "Testing " + tester2;
assertTrue(msg, tester2.test(newPerson));
print("Success!");
print(CR + "***** LEAVING PAGSTester.testStringEqualsIgnoreCaseTester() *****" + CR);
}
use of org.apereo.portal.security.IPerson in project uPortal by Jasig.
the class GuestUserTesterTest method createPerson.
protected static IPerson createPerson() throws Exception {
IPerson person = new PersonImpl();
person.setAttribute(IPerson.USERNAME, "non_guest");
return person;
}
use of org.apereo.portal.security.IPerson in project uPortal by Jasig.
the class GuestUserTesterTest method createGuestPerson.
protected static IPerson createGuestPerson() throws Exception {
IPerson person = new PersonImpl();
person.setAttribute(IPerson.USERNAME, "guest");
return person;
}
use of org.apereo.portal.security.IPerson in project uPortal by Jasig.
the class StylesheetUserPreferencesServiceImpl method getStylesheetPreferencesKey.
protected final StylesheetPreferencesKey getStylesheetPreferencesKey(HttpServletRequest request, PreferencesScope prefScope) {
final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
final IPerson person = userInstance.getPerson();
final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
final IUserProfile userProfile = preferencesManager.getUserProfile();
final IStylesheetDescriptor stylesheetDescriptor = getStylesheetDescriptor(request, prefScope);
return new StylesheetPreferencesKey(person, userProfile, stylesheetDescriptor);
}
use of org.apereo.portal.security.IPerson in project uPortal by Jasig.
the class PortletMarketplaceController method getLayoutInfo.
@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";
}
Aggregations