001
014
015 package com.liferay.portlet.wiki.model.impl;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.kernel.util.StringPool;
019 import com.liferay.portal.model.CacheModel;
020
021 import com.liferay.portlet.wiki.model.WikiPage;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class WikiPageCacheModel implements CacheModel<WikiPage>, Serializable {
035 @Override
036 public String toString() {
037 StringBundler sb = new StringBundler(47);
038
039 sb.append("{uuid=");
040 sb.append(uuid);
041 sb.append(", pageId=");
042 sb.append(pageId);
043 sb.append(", resourcePrimKey=");
044 sb.append(resourcePrimKey);
045 sb.append(", groupId=");
046 sb.append(groupId);
047 sb.append(", companyId=");
048 sb.append(companyId);
049 sb.append(", userId=");
050 sb.append(userId);
051 sb.append(", userName=");
052 sb.append(userName);
053 sb.append(", createDate=");
054 sb.append(createDate);
055 sb.append(", modifiedDate=");
056 sb.append(modifiedDate);
057 sb.append(", nodeId=");
058 sb.append(nodeId);
059 sb.append(", title=");
060 sb.append(title);
061 sb.append(", version=");
062 sb.append(version);
063 sb.append(", minorEdit=");
064 sb.append(minorEdit);
065 sb.append(", content=");
066 sb.append(content);
067 sb.append(", summary=");
068 sb.append(summary);
069 sb.append(", format=");
070 sb.append(format);
071 sb.append(", head=");
072 sb.append(head);
073 sb.append(", parentTitle=");
074 sb.append(parentTitle);
075 sb.append(", redirectTitle=");
076 sb.append(redirectTitle);
077 sb.append(", status=");
078 sb.append(status);
079 sb.append(", statusByUserId=");
080 sb.append(statusByUserId);
081 sb.append(", statusByUserName=");
082 sb.append(statusByUserName);
083 sb.append(", statusDate=");
084 sb.append(statusDate);
085 sb.append("}");
086
087 return sb.toString();
088 }
089
090 public WikiPage toEntityModel() {
091 WikiPageImpl wikiPageImpl = new WikiPageImpl();
092
093 if (uuid == null) {
094 wikiPageImpl.setUuid(StringPool.BLANK);
095 }
096 else {
097 wikiPageImpl.setUuid(uuid);
098 }
099
100 wikiPageImpl.setPageId(pageId);
101 wikiPageImpl.setResourcePrimKey(resourcePrimKey);
102 wikiPageImpl.setGroupId(groupId);
103 wikiPageImpl.setCompanyId(companyId);
104 wikiPageImpl.setUserId(userId);
105
106 if (userName == null) {
107 wikiPageImpl.setUserName(StringPool.BLANK);
108 }
109 else {
110 wikiPageImpl.setUserName(userName);
111 }
112
113 if (createDate == Long.MIN_VALUE) {
114 wikiPageImpl.setCreateDate(null);
115 }
116 else {
117 wikiPageImpl.setCreateDate(new Date(createDate));
118 }
119
120 if (modifiedDate == Long.MIN_VALUE) {
121 wikiPageImpl.setModifiedDate(null);
122 }
123 else {
124 wikiPageImpl.setModifiedDate(new Date(modifiedDate));
125 }
126
127 wikiPageImpl.setNodeId(nodeId);
128
129 if (title == null) {
130 wikiPageImpl.setTitle(StringPool.BLANK);
131 }
132 else {
133 wikiPageImpl.setTitle(title);
134 }
135
136 wikiPageImpl.setVersion(version);
137 wikiPageImpl.setMinorEdit(minorEdit);
138
139 if (content == null) {
140 wikiPageImpl.setContent(StringPool.BLANK);
141 }
142 else {
143 wikiPageImpl.setContent(content);
144 }
145
146 if (summary == null) {
147 wikiPageImpl.setSummary(StringPool.BLANK);
148 }
149 else {
150 wikiPageImpl.setSummary(summary);
151 }
152
153 if (format == null) {
154 wikiPageImpl.setFormat(StringPool.BLANK);
155 }
156 else {
157 wikiPageImpl.setFormat(format);
158 }
159
160 wikiPageImpl.setHead(head);
161
162 if (parentTitle == null) {
163 wikiPageImpl.setParentTitle(StringPool.BLANK);
164 }
165 else {
166 wikiPageImpl.setParentTitle(parentTitle);
167 }
168
169 if (redirectTitle == null) {
170 wikiPageImpl.setRedirectTitle(StringPool.BLANK);
171 }
172 else {
173 wikiPageImpl.setRedirectTitle(redirectTitle);
174 }
175
176 wikiPageImpl.setStatus(status);
177 wikiPageImpl.setStatusByUserId(statusByUserId);
178
179 if (statusByUserName == null) {
180 wikiPageImpl.setStatusByUserName(StringPool.BLANK);
181 }
182 else {
183 wikiPageImpl.setStatusByUserName(statusByUserName);
184 }
185
186 if (statusDate == Long.MIN_VALUE) {
187 wikiPageImpl.setStatusDate(null);
188 }
189 else {
190 wikiPageImpl.setStatusDate(new Date(statusDate));
191 }
192
193 wikiPageImpl.resetOriginalValues();
194
195 return wikiPageImpl;
196 }
197
198 public String uuid;
199 public long pageId;
200 public long resourcePrimKey;
201 public long groupId;
202 public long companyId;
203 public long userId;
204 public String userName;
205 public long createDate;
206 public long modifiedDate;
207 public long nodeId;
208 public String title;
209 public double version;
210 public boolean minorEdit;
211 public String content;
212 public String summary;
213 public String format;
214 public boolean head;
215 public String parentTitle;
216 public String redirectTitle;
217 public int status;
218 public long statusByUserId;
219 public String statusByUserName;
220 public long statusDate;
221 }