001/**
002 * Copyright 2005-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kns.datadictionary.control;
017
018import org.apache.commons.lang.StringUtils;
019
020/**
021 * The kualiUser element defines a control that identifies a Kuali user. As an example, consider a person with the
022 * following:
023 *      * User ID = JPJONES
024 *      * Universal User ID = 3583663872
025 *      * Employee ID = 0000123456
026 *      * Name = JONES,JOHN p
027 * This control defines a field in which the user can enter the User Id or choose a user using the magnifying glass
028 * lookup.  After a user is selected, user name will be displayed under the User ID.
029 *
030 * When using this control, the names of other attributes must be specified to allow the control to function:
031 *      * universalIdAttributeName  - attribute that provides the Universal User Id - e.g. 3583663872
032 *      * userIdAttributeName - attribute that provides the User Id - e.g. JPJONES
033 *      * personNameAttributeName - attribute that provides the User Name - e.g. JONES,JOHN P
034 *
035 * @deprecated Use {@link org.kuali.rice.krad.uif.control.UserControl}.
036 */
037@Deprecated
038public class KualiUserControlDefinition extends ControlDefinitionBase {
039    private static final long serialVersionUID = 4749994521411547705L;
040    
041        protected String universalIdAttributeName;
042    protected String userIdAttributeName;
043    protected String personNameAttributeName;
044
045    public KualiUserControlDefinition() {
046    }
047
048    /**
049     * 
050     * @see org.kuali.rice.krad.datadictionary.control.ControlDefinition#isKualiUser()
051     */
052    public boolean isKualiUser() {
053        return true;
054    }
055
056    /**
057     * 
058     * @see java.lang.Object#toString()
059     */
060    public String toString() {
061        return "KualiUserControlDefinition";
062    }
063
064    /**
065     * Gets the personNameAttributeName attribute.
066     * 
067     * @return Returns the personNameAttributeName.
068     */
069    public String getPersonNameAttributeName() {
070        return personNameAttributeName;
071    }
072
073    /**
074     * personNameAttributeName -
075                                attribute that provides the User Name - e.g. JONES,JOHN P
076     */
077    public void setPersonNameAttributeName(String personNameAttributeName) {
078        if (StringUtils.isBlank(personNameAttributeName)) {
079            throw new IllegalArgumentException("invalid (blank) personNameAttributeName");
080        }
081        this.personNameAttributeName = personNameAttributeName;
082    }
083
084    /**
085     * Gets the universalIdAttributeName attribute.
086     * 
087     * @return Returns the universalIdAttributeName.
088     */
089    public String getUniversalIdAttributeName() {
090        return universalIdAttributeName;
091    }
092
093    /**
094     * universalIdAttributeName  -
095                                attribute that provides the Universal User Id - e.g. 3583663872
096     */
097    public void setUniversalIdAttributeName(String universalIdAttributeName) {
098        if (StringUtils.isBlank(universalIdAttributeName)) {
099            throw new IllegalArgumentException("invalid (blank) universalIdAttributeName");
100        }
101        this.universalIdAttributeName = universalIdAttributeName;
102    }
103
104    /**
105     * Gets the userIdAttributeName attribute.
106     * 
107     * @return Returns the userIdAttributeName.
108     */
109    public String getUserIdAttributeName() {
110        return userIdAttributeName;
111    }
112
113    /**
114     * userIdAttributeName -
115                                attribute that provides the User Id - e.g. JPJONES
116     */
117    public void setUserIdAttributeName(String userIdAttributeName) {
118        if (StringUtils.isBlank(userIdAttributeName)) {
119            throw new IllegalArgumentException("invalid (blank) userIdAttributeName");
120        }
121        this.userIdAttributeName = userIdAttributeName;
122    }
123
124}