Site.java
3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.cms.entity;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
/**
* 站点Entity
* @author ThinkGem
* @version 2013-05-15
*/
public class Site extends DataEntity<Site> {
private static final long serialVersionUID = 1L;
private String name; // 站点名称
private String title; // 站点标题
private String logo; // 站点logo
private String description;// 描述,填写有助于搜索引擎优化
private String keywords;// 关键字,填写有助于搜索引擎优化
private String theme; // 主题
private String copyright;// 版权信息
private String customIndexView;// 自定义首页视图文件
private String domain;
public Site() {
super();
}
public Site(String id){
this();
this.id = id;
}
@Length(min=1, max=100)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Length(min=1, max=100)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
@Length(min=0, max=255)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Length(min=0, max=255)
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
@Length(min=1, max=255)
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public String getCopyright() {
return copyright;
}
public void setCopyright(String copyright) {
this.copyright = copyright;
}
public String getCustomIndexView() {
return customIndexView;
}
public void setCustomIndexView(String customIndexView) {
this.customIndexView = customIndexView;
}
/**
* 获取默认站点ID
*/
public static String defaultSiteId(){
return "1";
}
/**
* 判断是否为默认(主站)站点
*/
public static boolean isDefault(String id){
return id != null && id.equals(defaultSiteId());
}
/**
* 获取当前编辑的站点编号
*/
public static String getCurrentSiteId(){
String siteId = (String)UserUtils.getCache("siteId");
return StringUtils.isNotBlank(siteId)?siteId:defaultSiteId();
}
/**
* 模板路径
*/
public static final String TPL_BASE = "/WEB-INF/views/modules/cms/front/themes";
/**
* 获得模板方案路径。如:/WEB-INF/views/modules/cms/front/themes/jeesite
*
* @return
*/
public String getSolutionPath() {
return TPL_BASE + "/" + getTheme();
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
}