Examples of IUserProfile


Examples of org.entando.entando.aps.system.services.userprofile.model.IUserProfile

  }
 
  public void testAddGetContact() throws Throwable {
    try {
      Date birthdate1 = this._helper.setBirthdate(1981, 10, 25);
      IUserProfile profile1 = this._helper.createUserProfile(null,
          "name1 surname1", "indirizzoemail1@inesistente.itt", birthdate1, "it");
      Contact contact1 = this._helper.createContact(null, "editorCoach", true, profile1);
      // Aggiunta contatto1
      this._addressBookManager.addContact(contact1);
      IContact added1 = this._addressBookManager.getContact(contact1.getId());
      this.compareContacts(contact1, added1);
      assertNotNull(added1.getId());
      assertNotNull(added1.getContactInfo().getId());
     
      Date birthdate2 = this._helper.setBirthdate(1982, 10, 25);
      IUserProfile profile2 = this._helper.createUserProfile("pippo",
          "name2 surname2", "indirizzoemail2@inesistente.itt", birthdate2, "it");
      Contact contact2 = this._helper.createContact("pippo", "editorCoach", true, profile2);
      // Aggiunta contatto2
      this._addressBookManager.addContact(contact2);
      IContact added2 = this._addressBookManager.getContact(contact2.getId());
      this.compareContacts(contact2, added2);
      assertEquals("pippo", added2.getId());
      assertEquals("pippo", added2.getContactInfo().getId());
      assertEquals("pippo", profile2.getId());
    } catch (Throwable t) {
      throw t;
    } finally {
      this._helper.cleanAddressBook();
    }
View Full Code Here

Examples of org.entando.entando.aps.system.services.userprofile.model.IUserProfile

  }
 
  public void testUpdateDeleteContact() throws Throwable {
    try {
      Date birthdate = this._helper.setBirthdate(1982, 10, 25);
      IUserProfile profile = this._helper.createUserProfile(null,
          "name surname", "indirizzoemail@inesistente.itt", birthdate, "it");
      Contact contact = this._helper.createContact(null, "editorCoach", true, profile);
      // Aggiunta contatto
      this._addressBookManager.addContact(contact);
      IContact added = this._addressBookManager.getContact(contact.getId());
      this.compareContacts(contact, added);
     
      // Modifica contatto
      Date newBirthdate = this._helper.setBirthdate(1985, 12, 02);
      IUserProfile modifiedProfile = this._helper.createUserProfile(contact.getId(),
          "nameMOD surnameMOD", "indirizzoemailMOD@inesistente.itt", newBirthdate, "en");
      Contact modifiedContact = this._helper.createContact(contact.getId(), contact.getOwner(), false, modifiedProfile);
      this._addressBookManager.updateContact(contact.getOwner(), modifiedContact);
      IContact updated = this._addressBookManager.getContact(contact.getId());
      this.compareContacts(modifiedContact, updated);
View Full Code Here

Examples of org.entando.entando.aps.system.services.userprofile.model.IUserProfile

  }
 
  @Override
  public List<AttributeInterface> getSearcheableAttributes() {
    List<AttributeInterface> searcheableAttributes = new ArrayList<AttributeInterface>();
    IUserProfile defaultProfile = this.getUserProfileManager().getDefaultProfileType();
    defaultProfile.disableAttributes(JpaddressbookSystemConstants.ATTRIBUTE_DISABLING_CODE_ON_MANAGE_CONTACT);
    List<AttributeInterface> contentAttributes = defaultProfile.getAttributeList();
    for (int i=0; i<contentAttributes.size(); i++) {
      AttributeInterface attribute = contentAttributes.get(i);
      if (attribute.isActive() && attribute.isSearcheable()) {
        searcheableAttributes.add(attribute);
      }
View Full Code Here

Examples of org.entando.entando.aps.system.services.userprofile.model.IUserProfile

    this._helper = new JpaddressbookTestHelper(this.getApplicationContext());
  }
 
  public void testAddUpdateDeleteContact() throws Throwable {
    Date birthdate = this._helper.setBirthdate(1982, 10, 25);
    IUserProfile profile = this._helper.createUserProfile("mainEditor",
        "name surname", "indirizzoemail@inesistente.itt", birthdate, "it");
    Contact contact = this._helper.createContact("1", "editorCoach", true, profile);
    try {
      // Aggiunta contatto
      this._addressBookDAO.addContact(contact);
      ContactRecord record = (ContactRecord) this._addressBookDAO.loadEntityRecord(contact.getId());
      this.compareContacts(contact, record);
     
      // Modifica contatto
      Date newBirthdate = this._helper.setBirthdate(1964, 07, 01);
      IUserProfile modifiedProfile = this._helper.createUserProfile("supervisorCoach",
          "nameMOD surnameMOD", "indirizzoemailMOD@inesistente.itt", newBirthdate, "en");
      Contact modifiedContact = this._helper.createContact(contact.getId(), "pageManagerCoach", false, modifiedProfile);
      this._addressBookDAO.updateContact(modifiedContact);
      record = (ContactRecord) this._addressBookDAO.loadEntityRecord(contact.getId());
      modifiedContact.setOwner(contact.getOwner()); // FIXME ? Non modifica il proprietario del contatto
View Full Code Here

Examples of org.entando.entando.aps.system.services.userprofile.model.IUserProfile

    for (UserDetails user : systemUsers){
      user.addAutorities(this.getRoleManager().getAuthorizationsByUser(user));
      if (authManager.isAuthOnPermission(user, Permission.SUPERVISOR) || authManager.isAuthOnPermission(user, "editContents")) {
        try {
          AbstractUser userDetails = (AbstractUser) user;
          IUserProfile profile = profileManager.getProfile(userDetails.getUsername());
          userDetails.setProfile(profile);
        } catch (Throwable t) {
          ApsSystemUtils.logThrowable(t, this, "findContentOperators", "Error searching profile for user " + user.getUsername());
        }
        user.addAutorities(this.getGroupManager().getAuthorizationsByUser(user));
View Full Code Here

Examples of org.jasig.portal.IUserProfile

        when(userInstance.getPerson()).thenReturn(person);
       
        final IUserPreferencesManager preferencesManager = mock(IUserPreferencesManager.class);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
       
        final IUserProfile userProfile = mock(IUserProfile.class);
        when(preferencesManager.getUserProfile()).thenReturn(userProfile);
       
        final IUserLayoutManager userLayoutManager = mock(IUserLayoutManager.class);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        final IUserLayout userLayout = mock(IUserLayout.class);
        when(userLayoutManager.getUserLayout()).thenReturn(userLayout);
       
        when(userProfile.getThemeStylesheetId()).thenReturn(1);
       
        final IStylesheetDescriptor stylesheetDescriptor = mock(IStylesheetDescriptor.class);
        when(stylesheetDescriptorDao.getStylesheetDescriptor(1)).thenReturn(stylesheetDescriptor);
       
        final ILayoutAttributeDescriptor skinLayoutAttributeDescriptor = mock(ILayoutAttributeDescriptor.class);
View Full Code Here

Examples of org.jasig.portal.IUserProfile

        final IPerson person = mock(IPerson.class);
        when(person.getID()).thenReturn(1);
       
       
        final IUserProfile userProfile = mock(IUserProfile.class);
        when(userProfile.getProfileId()).thenReturn(1);
       
        final long supId = this.execute(new Callable<Long>() {
            @Override
            public Long call() throws Exception {
                final IStylesheetDescriptor stylesheetDescriptor = stylesheetDescriptorDao.getStylesheetDescriptor(ssdId);
View Full Code Here

Examples of org.jasig.portal.IUserProfile

        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 {
View Full Code Here

Examples of org.jasig.portal.IUserProfile

            IPortletWindow portletWindow, P propertiesPopulator) {
       
        // get the current user profile
        IUserInstance ui = userInstanceManager.getUserInstance(portletRequest);
        IUserPreferencesManager upm = ui.getPreferencesManager();
        IUserProfile profile = upm.getUserProfile();
       
        // get the theme for this profile
        long themeId = profile.getThemeStylesheetId();
        IStylesheetDescriptor theme = stylesheetDao.getStylesheetDescriptor(themeId);

        // set the theme name as a portlet response property
        final String themeName = theme.getName();
        propertiesPopulator.put(IPortletRenderer.THEME_NAME_PROPERTY, themeName);
View Full Code Here

Examples of org.jasig.portal.IUserProfile

    }

    protected IStylesheetDescriptor getThemeStylesheetDescriptor(HttpServletRequest request) {
        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
        final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
        final IUserProfile userProfile = preferencesManager.getUserProfile();
        final int themeStylesheetId = userProfile.getThemeStylesheetId();
       
        return stylesheetDescriptorDao.getStylesheetDescriptor(themeStylesheetId);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.