001    /**
002     * Copyright 2004-2013 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     */
016    package org.kuali.hr.time.user.pref;
017    
018    import org.apache.commons.lang.StringUtils;
019    import org.kuali.hr.core.KPMEConstants;
020    import org.kuali.hr.time.util.TKUtils;
021    import org.kuali.hr.time.util.TkConstants;
022    import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
023    
024    public class UserPreferences extends PersistableBusinessObjectBase {
025        public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "UserPreferences";
026        /**
027             *
028             */
029            private static final long serialVersionUID = 1L;
030            private String principalId;
031            private String timezone;
032    
033            public UserPreferences(){}
034    
035            public UserPreferences(String principalId, String timeZone){
036                    this.principalId = principalId;
037                    this.timezone = timeZone;
038            }
039    
040            public void setTimezone(String timezone) {
041                    this.timezone = timezone;
042            }
043    
044            public String getTimezone() {
045            if (StringUtils.isEmpty(timezone))
046                return TKUtils.getSystemTimeZone();
047    
048                    return timezone;
049            }
050    
051            public String getPrincipalId() {
052                    return principalId;
053            }
054    
055            public void setPrincipalId(String principalId) {
056                    this.principalId = principalId;
057            }
058    
059    }