All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.day.cq.security.profile.Profile Maven / Gradle / Ivy

/*
 * Copyright 1997-2009 Day Management AG
 * Barfuesserplatz 6, 4001 Basel, Switzerland
 * All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Day Management AG, ("Confidential Information"). You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Day.
 */
package com.day.cq.security.profile;

import com.day.cq.commons.LabeledResource;
import com.day.cq.security.Authorizable;
import org.apache.sling.api.resource.PersistableValueMap;
import org.apache.sling.api.resource.Resource;

import java.util.Iterator;

/**
 * The Profile is an Extension of the {@link Authorizable User} Properties.
 * While the Authorizable is a Unique entity it may have multiple Profiles.
 * A Profile may be specific for an Application of the CQ-Platform.
 * It is therefore modelled via this Object and not maintained directly on the
 * Authorizable.
 * The relation to an {@link com.day.cq.security.Authorizable Authorizable} and
 * the persistance handling is done by the
 * {@link com.day.cq.security.profile.ProfileManager ProfileManager}
 *
 * @see Authorizable
 * @see ProfileManager
 * @deprecated cq 5.5
 */
public interface Profile extends LabeledResource, PersistableValueMap {

    /**
     * @return this Profile belongs to
     */
    Authorizable getAuthorizable();

    /**
     * @return Path of the Resource containing the profile data
     */
    String getPath();

    /**
     * @return Family or Last Name or null if none
     */
    String getFamilyName();

    /**
     * @return Given or First Name null if none
     */
    String getGivenName();

    /**
     * @return Given or First Name null if none
     */
    String getMiddleName();

    /**
     * @return Honric Prefix like Ph.D null if none
     */
    String getHonoricPrefix();

    /**
     * @return Honric Suffix or null if none
     */
    String getHonoricSuffix();

    /**
     * @return formatted name of the profile
     */
    String getFormattedName();

    /**
     * @return e-mail address marked to be primary or null if none
     */
    String getPrimaryMail();

    /**
     * A Profile may contain mulitple E-Mail addresses.
     * These multiple addresses are stored in dedicated resources, containing
     * the e-mail address and descriptive data.
     * It is not mandated, that the {@link #getPrimaryMail() primary E-Mail}
     * is contained in one of the {@link Resource Resources} contained in this result
     *
     * @return all Resources containing detailed properties about mail addresses.
     * @see #getPrimaryMail()
     */
    Iterator getMails();

    /**
     * @return address marked to be primary or null if none
     */
    String getPrimaryPhone();

    /**
     * A Profile may contain mulitple Phone numbers addresses.
     * These multiple phone numbers are stored in dedicated resources, containing
     * the number and descriptive data.
     * It is not mandated, that the {@link #getPrimaryPhone() primary phone number}
     * is contained in one of the {@link Resource Resources} contained in this result
     *
     * @return all Resources containing detailed properties about phone numbers.
     * @see #getPrimaryPhone()
     */
    Iterator getPhoneNumbers();

    Resource getCurrentLocation();

    Iterator getAddresses();

    Iterator getURLs();

    Iterator getPhotos();

    Iterator getOrganizations();

    Iterator getAccounts();

    /**
     * Returns the avatar URL of the profile.
     * @param suffix Suffix to append to the avatar URL
     * @param defaultValue Default value if Profile has no avatar
     * @return avatar URL or the default value
     */
    String getAvatarURL(String suffix, String defaultValue);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy