View Javadoc

1   /**
2    * Copyright 2004-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.hr.time.user.pref;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.kuali.hr.core.KPMEConstants;
20  import org.kuali.hr.time.util.TKUtils;
21  import org.kuali.hr.time.util.TkConstants;
22  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23  
24  public class UserPreferences extends PersistableBusinessObjectBase {
25      public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "UserPreferences";
26      /**
27  	 *
28  	 */
29  	private static final long serialVersionUID = 1L;
30  	private String principalId;
31  	private String timezone;
32  
33  	public UserPreferences(){}
34  
35  	public UserPreferences(String principalId, String timeZone){
36  		this.principalId = principalId;
37  		this.timezone = timeZone;
38  	}
39  
40  	public void setTimezone(String timezone) {
41  		this.timezone = timezone;
42  	}
43  
44  	public String getTimezone() {
45          if (StringUtils.isEmpty(timezone))
46              return TKUtils.getSystemTimeZone();
47  
48  		return timezone;
49  	}
50  
51  	public String getPrincipalId() {
52  		return principalId;
53  	}
54  
55  	public void setPrincipalId(String principalId) {
56  		this.principalId = principalId;
57  	}
58  
59  }