001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.wiki.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.json.JSON;
020    import com.liferay.portal.kernel.util.GetterUtil;
021    import com.liferay.portal.kernel.util.ProxyUtil;
022    import com.liferay.portal.kernel.util.StringBundler;
023    import com.liferay.portal.kernel.util.StringPool;
024    import com.liferay.portal.kernel.workflow.WorkflowConstants;
025    import com.liferay.portal.model.CacheModel;
026    import com.liferay.portal.model.impl.BaseModelImpl;
027    import com.liferay.portal.service.ServiceContext;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import com.liferay.portlet.expando.model.ExpandoBridge;
031    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
032    import com.liferay.portlet.wiki.model.WikiPage;
033    import com.liferay.portlet.wiki.model.WikiPageModel;
034    import com.liferay.portlet.wiki.model.WikiPageSoap;
035    
036    import java.io.Serializable;
037    
038    import java.sql.Types;
039    
040    import java.util.ArrayList;
041    import java.util.Date;
042    import java.util.HashMap;
043    import java.util.List;
044    import java.util.Map;
045    
046    /**
047     * The base model implementation for the WikiPage service. Represents a row in the "WikiPage" database table, with each column mapped to a property of this class.
048     *
049     * <p>
050     * This implementation and its corresponding interface {@link com.liferay.portlet.wiki.model.WikiPageModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link WikiPageImpl}.
051     * </p>
052     *
053     * @author Brian Wing Shun Chan
054     * @see WikiPageImpl
055     * @see com.liferay.portlet.wiki.model.WikiPage
056     * @see com.liferay.portlet.wiki.model.WikiPageModel
057     * @generated
058     */
059    @JSON(strict = true)
060    public class WikiPageModelImpl extends BaseModelImpl<WikiPage>
061            implements WikiPageModel {
062            /*
063             * NOTE FOR DEVELOPERS:
064             *
065             * Never modify or reference this class directly. All methods that expect a wiki page model instance should use the {@link com.liferay.portlet.wiki.model.WikiPage} interface instead.
066             */
067            public static final String TABLE_NAME = "WikiPage";
068            public static final Object[][] TABLE_COLUMNS = {
069                            { "uuid_", Types.VARCHAR },
070                            { "pageId", Types.BIGINT },
071                            { "resourcePrimKey", Types.BIGINT },
072                            { "groupId", Types.BIGINT },
073                            { "companyId", Types.BIGINT },
074                            { "userId", Types.BIGINT },
075                            { "userName", Types.VARCHAR },
076                            { "createDate", Types.TIMESTAMP },
077                            { "modifiedDate", Types.TIMESTAMP },
078                            { "nodeId", Types.BIGINT },
079                            { "title", Types.VARCHAR },
080                            { "version", Types.DOUBLE },
081                            { "minorEdit", Types.BOOLEAN },
082                            { "content", Types.CLOB },
083                            { "summary", Types.VARCHAR },
084                            { "format", Types.VARCHAR },
085                            { "head", Types.BOOLEAN },
086                            { "parentTitle", Types.VARCHAR },
087                            { "redirectTitle", Types.VARCHAR },
088                            { "status", Types.INTEGER },
089                            { "statusByUserId", Types.BIGINT },
090                            { "statusByUserName", Types.VARCHAR },
091                            { "statusDate", Types.TIMESTAMP }
092                    };
093            public static final String TABLE_SQL_CREATE = "create table WikiPage (uuid_ VARCHAR(75) null,pageId LONG not null primary key,resourcePrimKey LONG,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,nodeId LONG,title VARCHAR(255) null,version DOUBLE,minorEdit BOOLEAN,content TEXT null,summary STRING null,format VARCHAR(75) null,head BOOLEAN,parentTitle VARCHAR(255) null,redirectTitle VARCHAR(255) null,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
094            public static final String TABLE_SQL_DROP = "drop table WikiPage";
095            public static final String ORDER_BY_JPQL = " ORDER BY wikiPage.nodeId ASC, wikiPage.title ASC, wikiPage.version DESC";
096            public static final String ORDER_BY_SQL = " ORDER BY WikiPage.nodeId ASC, WikiPage.title ASC, WikiPage.version DESC";
097            public static final String DATA_SOURCE = "liferayDataSource";
098            public static final String SESSION_FACTORY = "liferaySessionFactory";
099            public static final String TX_MANAGER = "liferayTransactionManager";
100            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
101                                    "value.object.entity.cache.enabled.com.liferay.portlet.wiki.model.WikiPage"),
102                            true);
103            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
104                                    "value.object.finder.cache.enabled.com.liferay.portlet.wiki.model.WikiPage"),
105                            true);
106            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
107                                    "value.object.column.bitmask.enabled.com.liferay.portlet.wiki.model.WikiPage"),
108                            true);
109            public static long COMPANYID_COLUMN_BITMASK = 1L;
110            public static long FORMAT_COLUMN_BITMASK = 2L;
111            public static long GROUPID_COLUMN_BITMASK = 4L;
112            public static long HEAD_COLUMN_BITMASK = 8L;
113            public static long NODEID_COLUMN_BITMASK = 16L;
114            public static long PARENTTITLE_COLUMN_BITMASK = 32L;
115            public static long REDIRECTTITLE_COLUMN_BITMASK = 64L;
116            public static long RESOURCEPRIMKEY_COLUMN_BITMASK = 128L;
117            public static long STATUS_COLUMN_BITMASK = 256L;
118            public static long TITLE_COLUMN_BITMASK = 512L;
119            public static long USERID_COLUMN_BITMASK = 1024L;
120            public static long UUID_COLUMN_BITMASK = 2048L;
121            public static long VERSION_COLUMN_BITMASK = 4096L;
122    
123            /**
124             * Converts the soap model instance into a normal model instance.
125             *
126             * @param soapModel the soap model instance to convert
127             * @return the normal model instance
128             */
129            public static WikiPage toModel(WikiPageSoap soapModel) {
130                    if (soapModel == null) {
131                            return null;
132                    }
133    
134                    WikiPage model = new WikiPageImpl();
135    
136                    model.setUuid(soapModel.getUuid());
137                    model.setPageId(soapModel.getPageId());
138                    model.setResourcePrimKey(soapModel.getResourcePrimKey());
139                    model.setGroupId(soapModel.getGroupId());
140                    model.setCompanyId(soapModel.getCompanyId());
141                    model.setUserId(soapModel.getUserId());
142                    model.setUserName(soapModel.getUserName());
143                    model.setCreateDate(soapModel.getCreateDate());
144                    model.setModifiedDate(soapModel.getModifiedDate());
145                    model.setNodeId(soapModel.getNodeId());
146                    model.setTitle(soapModel.getTitle());
147                    model.setVersion(soapModel.getVersion());
148                    model.setMinorEdit(soapModel.getMinorEdit());
149                    model.setContent(soapModel.getContent());
150                    model.setSummary(soapModel.getSummary());
151                    model.setFormat(soapModel.getFormat());
152                    model.setHead(soapModel.getHead());
153                    model.setParentTitle(soapModel.getParentTitle());
154                    model.setRedirectTitle(soapModel.getRedirectTitle());
155                    model.setStatus(soapModel.getStatus());
156                    model.setStatusByUserId(soapModel.getStatusByUserId());
157                    model.setStatusByUserName(soapModel.getStatusByUserName());
158                    model.setStatusDate(soapModel.getStatusDate());
159    
160                    return model;
161            }
162    
163            /**
164             * Converts the soap model instances into normal model instances.
165             *
166             * @param soapModels the soap model instances to convert
167             * @return the normal model instances
168             */
169            public static List<WikiPage> toModels(WikiPageSoap[] soapModels) {
170                    if (soapModels == null) {
171                            return null;
172                    }
173    
174                    List<WikiPage> models = new ArrayList<WikiPage>(soapModels.length);
175    
176                    for (WikiPageSoap soapModel : soapModels) {
177                            models.add(toModel(soapModel));
178                    }
179    
180                    return models;
181            }
182    
183            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
184                                    "lock.expiration.time.com.liferay.portlet.wiki.model.WikiPage"));
185    
186            public WikiPageModelImpl() {
187            }
188    
189            public long getPrimaryKey() {
190                    return _pageId;
191            }
192    
193            public void setPrimaryKey(long primaryKey) {
194                    setPageId(primaryKey);
195            }
196    
197            public Serializable getPrimaryKeyObj() {
198                    return new Long(_pageId);
199            }
200    
201            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
202                    setPrimaryKey(((Long)primaryKeyObj).longValue());
203            }
204    
205            public Class<?> getModelClass() {
206                    return WikiPage.class;
207            }
208    
209            public String getModelClassName() {
210                    return WikiPage.class.getName();
211            }
212    
213            @Override
214            public Map<String, Object> getModelAttributes() {
215                    Map<String, Object> attributes = new HashMap<String, Object>();
216    
217                    attributes.put("uuid", getUuid());
218                    attributes.put("pageId", getPageId());
219                    attributes.put("resourcePrimKey", getResourcePrimKey());
220                    attributes.put("groupId", getGroupId());
221                    attributes.put("companyId", getCompanyId());
222                    attributes.put("userId", getUserId());
223                    attributes.put("userName", getUserName());
224                    attributes.put("createDate", getCreateDate());
225                    attributes.put("modifiedDate", getModifiedDate());
226                    attributes.put("nodeId", getNodeId());
227                    attributes.put("title", getTitle());
228                    attributes.put("version", getVersion());
229                    attributes.put("minorEdit", getMinorEdit());
230                    attributes.put("content", getContent());
231                    attributes.put("summary", getSummary());
232                    attributes.put("format", getFormat());
233                    attributes.put("head", getHead());
234                    attributes.put("parentTitle", getParentTitle());
235                    attributes.put("redirectTitle", getRedirectTitle());
236                    attributes.put("status", getStatus());
237                    attributes.put("statusByUserId", getStatusByUserId());
238                    attributes.put("statusByUserName", getStatusByUserName());
239                    attributes.put("statusDate", getStatusDate());
240    
241                    return attributes;
242            }
243    
244            @Override
245            public void setModelAttributes(Map<String, Object> attributes) {
246                    String uuid = (String)attributes.get("uuid");
247    
248                    if (uuid != null) {
249                            setUuid(uuid);
250                    }
251    
252                    Long pageId = (Long)attributes.get("pageId");
253    
254                    if (pageId != null) {
255                            setPageId(pageId);
256                    }
257    
258                    Long resourcePrimKey = (Long)attributes.get("resourcePrimKey");
259    
260                    if (resourcePrimKey != null) {
261                            setResourcePrimKey(resourcePrimKey);
262                    }
263    
264                    Long groupId = (Long)attributes.get("groupId");
265    
266                    if (groupId != null) {
267                            setGroupId(groupId);
268                    }
269    
270                    Long companyId = (Long)attributes.get("companyId");
271    
272                    if (companyId != null) {
273                            setCompanyId(companyId);
274                    }
275    
276                    Long userId = (Long)attributes.get("userId");
277    
278                    if (userId != null) {
279                            setUserId(userId);
280                    }
281    
282                    String userName = (String)attributes.get("userName");
283    
284                    if (userName != null) {
285                            setUserName(userName);
286                    }
287    
288                    Date createDate = (Date)attributes.get("createDate");
289    
290                    if (createDate != null) {
291                            setCreateDate(createDate);
292                    }
293    
294                    Date modifiedDate = (Date)attributes.get("modifiedDate");
295    
296                    if (modifiedDate != null) {
297                            setModifiedDate(modifiedDate);
298                    }
299    
300                    Long nodeId = (Long)attributes.get("nodeId");
301    
302                    if (nodeId != null) {
303                            setNodeId(nodeId);
304                    }
305    
306                    String title = (String)attributes.get("title");
307    
308                    if (title != null) {
309                            setTitle(title);
310                    }
311    
312                    Double version = (Double)attributes.get("version");
313    
314                    if (version != null) {
315                            setVersion(version);
316                    }
317    
318                    Boolean minorEdit = (Boolean)attributes.get("minorEdit");
319    
320                    if (minorEdit != null) {
321                            setMinorEdit(minorEdit);
322                    }
323    
324                    String content = (String)attributes.get("content");
325    
326                    if (content != null) {
327                            setContent(content);
328                    }
329    
330                    String summary = (String)attributes.get("summary");
331    
332                    if (summary != null) {
333                            setSummary(summary);
334                    }
335    
336                    String format = (String)attributes.get("format");
337    
338                    if (format != null) {
339                            setFormat(format);
340                    }
341    
342                    Boolean head = (Boolean)attributes.get("head");
343    
344                    if (head != null) {
345                            setHead(head);
346                    }
347    
348                    String parentTitle = (String)attributes.get("parentTitle");
349    
350                    if (parentTitle != null) {
351                            setParentTitle(parentTitle);
352                    }
353    
354                    String redirectTitle = (String)attributes.get("redirectTitle");
355    
356                    if (redirectTitle != null) {
357                            setRedirectTitle(redirectTitle);
358                    }
359    
360                    Integer status = (Integer)attributes.get("status");
361    
362                    if (status != null) {
363                            setStatus(status);
364                    }
365    
366                    Long statusByUserId = (Long)attributes.get("statusByUserId");
367    
368                    if (statusByUserId != null) {
369                            setStatusByUserId(statusByUserId);
370                    }
371    
372                    String statusByUserName = (String)attributes.get("statusByUserName");
373    
374                    if (statusByUserName != null) {
375                            setStatusByUserName(statusByUserName);
376                    }
377    
378                    Date statusDate = (Date)attributes.get("statusDate");
379    
380                    if (statusDate != null) {
381                            setStatusDate(statusDate);
382                    }
383            }
384    
385            @JSON
386            public String getUuid() {
387                    if (_uuid == null) {
388                            return StringPool.BLANK;
389                    }
390                    else {
391                            return _uuid;
392                    }
393            }
394    
395            public void setUuid(String uuid) {
396                    if (_originalUuid == null) {
397                            _originalUuid = _uuid;
398                    }
399    
400                    _uuid = uuid;
401            }
402    
403            public String getOriginalUuid() {
404                    return GetterUtil.getString(_originalUuid);
405            }
406    
407            @JSON
408            public long getPageId() {
409                    return _pageId;
410            }
411    
412            public void setPageId(long pageId) {
413                    _pageId = pageId;
414            }
415    
416            @JSON
417            public long getResourcePrimKey() {
418                    return _resourcePrimKey;
419            }
420    
421            public void setResourcePrimKey(long resourcePrimKey) {
422                    _columnBitmask |= RESOURCEPRIMKEY_COLUMN_BITMASK;
423    
424                    if (!_setOriginalResourcePrimKey) {
425                            _setOriginalResourcePrimKey = true;
426    
427                            _originalResourcePrimKey = _resourcePrimKey;
428                    }
429    
430                    _resourcePrimKey = resourcePrimKey;
431            }
432    
433            public boolean isResourceMain() {
434                    return true;
435            }
436    
437            public long getOriginalResourcePrimKey() {
438                    return _originalResourcePrimKey;
439            }
440    
441            @JSON
442            public long getGroupId() {
443                    return _groupId;
444            }
445    
446            public void setGroupId(long groupId) {
447                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
448    
449                    if (!_setOriginalGroupId) {
450                            _setOriginalGroupId = true;
451    
452                            _originalGroupId = _groupId;
453                    }
454    
455                    _groupId = groupId;
456            }
457    
458            public long getOriginalGroupId() {
459                    return _originalGroupId;
460            }
461    
462            @JSON
463            public long getCompanyId() {
464                    return _companyId;
465            }
466    
467            public void setCompanyId(long companyId) {
468                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
469    
470                    if (!_setOriginalCompanyId) {
471                            _setOriginalCompanyId = true;
472    
473                            _originalCompanyId = _companyId;
474                    }
475    
476                    _companyId = companyId;
477            }
478    
479            public long getOriginalCompanyId() {
480                    return _originalCompanyId;
481            }
482    
483            @JSON
484            public long getUserId() {
485                    return _userId;
486            }
487    
488            public void setUserId(long userId) {
489                    _columnBitmask |= USERID_COLUMN_BITMASK;
490    
491                    if (!_setOriginalUserId) {
492                            _setOriginalUserId = true;
493    
494                            _originalUserId = _userId;
495                    }
496    
497                    _userId = userId;
498            }
499    
500            public String getUserUuid() throws SystemException {
501                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
502            }
503    
504            public void setUserUuid(String userUuid) {
505                    _userUuid = userUuid;
506            }
507    
508            public long getOriginalUserId() {
509                    return _originalUserId;
510            }
511    
512            @JSON
513            public String getUserName() {
514                    if (_userName == null) {
515                            return StringPool.BLANK;
516                    }
517                    else {
518                            return _userName;
519                    }
520            }
521    
522            public void setUserName(String userName) {
523                    _userName = userName;
524            }
525    
526            @JSON
527            public Date getCreateDate() {
528                    return _createDate;
529            }
530    
531            public void setCreateDate(Date createDate) {
532                    _createDate = createDate;
533            }
534    
535            @JSON
536            public Date getModifiedDate() {
537                    return _modifiedDate;
538            }
539    
540            public void setModifiedDate(Date modifiedDate) {
541                    _modifiedDate = modifiedDate;
542            }
543    
544            @JSON
545            public long getNodeId() {
546                    return _nodeId;
547            }
548    
549            public void setNodeId(long nodeId) {
550                    _columnBitmask = -1L;
551    
552                    if (!_setOriginalNodeId) {
553                            _setOriginalNodeId = true;
554    
555                            _originalNodeId = _nodeId;
556                    }
557    
558                    _nodeId = nodeId;
559            }
560    
561            public long getOriginalNodeId() {
562                    return _originalNodeId;
563            }
564    
565            @JSON
566            public String getTitle() {
567                    if (_title == null) {
568                            return StringPool.BLANK;
569                    }
570                    else {
571                            return _title;
572                    }
573            }
574    
575            public void setTitle(String title) {
576                    _columnBitmask = -1L;
577    
578                    if (_originalTitle == null) {
579                            _originalTitle = _title;
580                    }
581    
582                    _title = title;
583            }
584    
585            public String getOriginalTitle() {
586                    return GetterUtil.getString(_originalTitle);
587            }
588    
589            @JSON
590            public double getVersion() {
591                    return _version;
592            }
593    
594            public void setVersion(double version) {
595                    _columnBitmask = -1L;
596    
597                    if (!_setOriginalVersion) {
598                            _setOriginalVersion = true;
599    
600                            _originalVersion = _version;
601                    }
602    
603                    _version = version;
604            }
605    
606            public double getOriginalVersion() {
607                    return _originalVersion;
608            }
609    
610            @JSON
611            public boolean getMinorEdit() {
612                    return _minorEdit;
613            }
614    
615            public boolean isMinorEdit() {
616                    return _minorEdit;
617            }
618    
619            public void setMinorEdit(boolean minorEdit) {
620                    _minorEdit = minorEdit;
621            }
622    
623            @JSON
624            public String getContent() {
625                    if (_content == null) {
626                            return StringPool.BLANK;
627                    }
628                    else {
629                            return _content;
630                    }
631            }
632    
633            public void setContent(String content) {
634                    _content = content;
635            }
636    
637            @JSON
638            public String getSummary() {
639                    if (_summary == null) {
640                            return StringPool.BLANK;
641                    }
642                    else {
643                            return _summary;
644                    }
645            }
646    
647            public void setSummary(String summary) {
648                    _summary = summary;
649            }
650    
651            @JSON
652            public String getFormat() {
653                    if (_format == null) {
654                            return StringPool.BLANK;
655                    }
656                    else {
657                            return _format;
658                    }
659            }
660    
661            public void setFormat(String format) {
662                    _columnBitmask |= FORMAT_COLUMN_BITMASK;
663    
664                    if (_originalFormat == null) {
665                            _originalFormat = _format;
666                    }
667    
668                    _format = format;
669            }
670    
671            public String getOriginalFormat() {
672                    return GetterUtil.getString(_originalFormat);
673            }
674    
675            @JSON
676            public boolean getHead() {
677                    return _head;
678            }
679    
680            public boolean isHead() {
681                    return _head;
682            }
683    
684            public void setHead(boolean head) {
685                    _columnBitmask |= HEAD_COLUMN_BITMASK;
686    
687                    if (!_setOriginalHead) {
688                            _setOriginalHead = true;
689    
690                            _originalHead = _head;
691                    }
692    
693                    _head = head;
694            }
695    
696            public boolean getOriginalHead() {
697                    return _originalHead;
698            }
699    
700            @JSON
701            public String getParentTitle() {
702                    if (_parentTitle == null) {
703                            return StringPool.BLANK;
704                    }
705                    else {
706                            return _parentTitle;
707                    }
708            }
709    
710            public void setParentTitle(String parentTitle) {
711                    _columnBitmask |= PARENTTITLE_COLUMN_BITMASK;
712    
713                    if (_originalParentTitle == null) {
714                            _originalParentTitle = _parentTitle;
715                    }
716    
717                    _parentTitle = parentTitle;
718            }
719    
720            public String getOriginalParentTitle() {
721                    return GetterUtil.getString(_originalParentTitle);
722            }
723    
724            @JSON
725            public String getRedirectTitle() {
726                    if (_redirectTitle == null) {
727                            return StringPool.BLANK;
728                    }
729                    else {
730                            return _redirectTitle;
731                    }
732            }
733    
734            public void setRedirectTitle(String redirectTitle) {
735                    _columnBitmask |= REDIRECTTITLE_COLUMN_BITMASK;
736    
737                    if (_originalRedirectTitle == null) {
738                            _originalRedirectTitle = _redirectTitle;
739                    }
740    
741                    _redirectTitle = redirectTitle;
742            }
743    
744            public String getOriginalRedirectTitle() {
745                    return GetterUtil.getString(_originalRedirectTitle);
746            }
747    
748            @JSON
749            public int getStatus() {
750                    return _status;
751            }
752    
753            public void setStatus(int status) {
754                    _columnBitmask |= STATUS_COLUMN_BITMASK;
755    
756                    if (!_setOriginalStatus) {
757                            _setOriginalStatus = true;
758    
759                            _originalStatus = _status;
760                    }
761    
762                    _status = status;
763            }
764    
765            public int getOriginalStatus() {
766                    return _originalStatus;
767            }
768    
769            @JSON
770            public long getStatusByUserId() {
771                    return _statusByUserId;
772            }
773    
774            public void setStatusByUserId(long statusByUserId) {
775                    _statusByUserId = statusByUserId;
776            }
777    
778            public String getStatusByUserUuid() throws SystemException {
779                    return PortalUtil.getUserValue(getStatusByUserId(), "uuid",
780                            _statusByUserUuid);
781            }
782    
783            public void setStatusByUserUuid(String statusByUserUuid) {
784                    _statusByUserUuid = statusByUserUuid;
785            }
786    
787            @JSON
788            public String getStatusByUserName() {
789                    if (_statusByUserName == null) {
790                            return StringPool.BLANK;
791                    }
792                    else {
793                            return _statusByUserName;
794                    }
795            }
796    
797            public void setStatusByUserName(String statusByUserName) {
798                    _statusByUserName = statusByUserName;
799            }
800    
801            @JSON
802            public Date getStatusDate() {
803                    return _statusDate;
804            }
805    
806            public void setStatusDate(Date statusDate) {
807                    _statusDate = statusDate;
808            }
809    
810            /**
811             * @deprecated {@link #isApproved}
812             */
813            public boolean getApproved() {
814                    return isApproved();
815            }
816    
817            public boolean isApproved() {
818                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
819                            return true;
820                    }
821                    else {
822                            return false;
823                    }
824            }
825    
826            public boolean isDenied() {
827                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
828                            return true;
829                    }
830                    else {
831                            return false;
832                    }
833            }
834    
835            public boolean isDraft() {
836                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
837                            return true;
838                    }
839                    else {
840                            return false;
841                    }
842            }
843    
844            public boolean isExpired() {
845                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
846                            return true;
847                    }
848                    else {
849                            return false;
850                    }
851            }
852    
853            public boolean isInactive() {
854                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
855                            return true;
856                    }
857                    else {
858                            return false;
859                    }
860            }
861    
862            public boolean isIncomplete() {
863                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
864                            return true;
865                    }
866                    else {
867                            return false;
868                    }
869            }
870    
871            public boolean isInTrash() {
872                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
873                            return true;
874                    }
875                    else {
876                            return false;
877                    }
878            }
879    
880            public boolean isPending() {
881                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
882                            return true;
883                    }
884                    else {
885                            return false;
886                    }
887            }
888    
889            public boolean isScheduled() {
890                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
891                            return true;
892                    }
893                    else {
894                            return false;
895                    }
896            }
897    
898            public long getColumnBitmask() {
899                    return _columnBitmask;
900            }
901    
902            @Override
903            public ExpandoBridge getExpandoBridge() {
904                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
905                            WikiPage.class.getName(), getPrimaryKey());
906            }
907    
908            @Override
909            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
910                    ExpandoBridge expandoBridge = getExpandoBridge();
911    
912                    expandoBridge.setAttributes(serviceContext);
913            }
914    
915            @Override
916            public WikiPage toEscapedModel() {
917                    if (_escapedModel == null) {
918                            _escapedModel = (WikiPage)ProxyUtil.newProxyInstance(_classLoader,
919                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
920                    }
921    
922                    return _escapedModel;
923            }
924    
925            @Override
926            public Object clone() {
927                    WikiPageImpl wikiPageImpl = new WikiPageImpl();
928    
929                    wikiPageImpl.setUuid(getUuid());
930                    wikiPageImpl.setPageId(getPageId());
931                    wikiPageImpl.setResourcePrimKey(getResourcePrimKey());
932                    wikiPageImpl.setGroupId(getGroupId());
933                    wikiPageImpl.setCompanyId(getCompanyId());
934                    wikiPageImpl.setUserId(getUserId());
935                    wikiPageImpl.setUserName(getUserName());
936                    wikiPageImpl.setCreateDate(getCreateDate());
937                    wikiPageImpl.setModifiedDate(getModifiedDate());
938                    wikiPageImpl.setNodeId(getNodeId());
939                    wikiPageImpl.setTitle(getTitle());
940                    wikiPageImpl.setVersion(getVersion());
941                    wikiPageImpl.setMinorEdit(getMinorEdit());
942                    wikiPageImpl.setContent(getContent());
943                    wikiPageImpl.setSummary(getSummary());
944                    wikiPageImpl.setFormat(getFormat());
945                    wikiPageImpl.setHead(getHead());
946                    wikiPageImpl.setParentTitle(getParentTitle());
947                    wikiPageImpl.setRedirectTitle(getRedirectTitle());
948                    wikiPageImpl.setStatus(getStatus());
949                    wikiPageImpl.setStatusByUserId(getStatusByUserId());
950                    wikiPageImpl.setStatusByUserName(getStatusByUserName());
951                    wikiPageImpl.setStatusDate(getStatusDate());
952    
953                    wikiPageImpl.resetOriginalValues();
954    
955                    return wikiPageImpl;
956            }
957    
958            public int compareTo(WikiPage wikiPage) {
959                    int value = 0;
960    
961                    if (getNodeId() < wikiPage.getNodeId()) {
962                            value = -1;
963                    }
964                    else if (getNodeId() > wikiPage.getNodeId()) {
965                            value = 1;
966                    }
967                    else {
968                            value = 0;
969                    }
970    
971                    if (value != 0) {
972                            return value;
973                    }
974    
975                    value = getTitle().toLowerCase()
976                                            .compareTo(wikiPage.getTitle().toLowerCase());
977    
978                    if (value != 0) {
979                            return value;
980                    }
981    
982                    if (getVersion() < wikiPage.getVersion()) {
983                            value = -1;
984                    }
985                    else if (getVersion() > wikiPage.getVersion()) {
986                            value = 1;
987                    }
988                    else {
989                            value = 0;
990                    }
991    
992                    value = value * -1;
993    
994                    if (value != 0) {
995                            return value;
996                    }
997    
998                    return 0;
999            }
1000    
1001            @Override
1002            public boolean equals(Object obj) {
1003                    if (obj == null) {
1004                            return false;
1005                    }
1006    
1007                    WikiPage wikiPage = null;
1008    
1009                    try {
1010                            wikiPage = (WikiPage)obj;
1011                    }
1012                    catch (ClassCastException cce) {
1013                            return false;
1014                    }
1015    
1016                    long primaryKey = wikiPage.getPrimaryKey();
1017    
1018                    if (getPrimaryKey() == primaryKey) {
1019                            return true;
1020                    }
1021                    else {
1022                            return false;
1023                    }
1024            }
1025    
1026            @Override
1027            public int hashCode() {
1028                    return (int)getPrimaryKey();
1029            }
1030    
1031            @Override
1032            public void resetOriginalValues() {
1033                    WikiPageModelImpl wikiPageModelImpl = this;
1034    
1035                    wikiPageModelImpl._originalUuid = wikiPageModelImpl._uuid;
1036    
1037                    wikiPageModelImpl._originalResourcePrimKey = wikiPageModelImpl._resourcePrimKey;
1038    
1039                    wikiPageModelImpl._setOriginalResourcePrimKey = false;
1040    
1041                    wikiPageModelImpl._originalGroupId = wikiPageModelImpl._groupId;
1042    
1043                    wikiPageModelImpl._setOriginalGroupId = false;
1044    
1045                    wikiPageModelImpl._originalCompanyId = wikiPageModelImpl._companyId;
1046    
1047                    wikiPageModelImpl._setOriginalCompanyId = false;
1048    
1049                    wikiPageModelImpl._originalUserId = wikiPageModelImpl._userId;
1050    
1051                    wikiPageModelImpl._setOriginalUserId = false;
1052    
1053                    wikiPageModelImpl._originalNodeId = wikiPageModelImpl._nodeId;
1054    
1055                    wikiPageModelImpl._setOriginalNodeId = false;
1056    
1057                    wikiPageModelImpl._originalTitle = wikiPageModelImpl._title;
1058    
1059                    wikiPageModelImpl._originalVersion = wikiPageModelImpl._version;
1060    
1061                    wikiPageModelImpl._setOriginalVersion = false;
1062    
1063                    wikiPageModelImpl._originalFormat = wikiPageModelImpl._format;
1064    
1065                    wikiPageModelImpl._originalHead = wikiPageModelImpl._head;
1066    
1067                    wikiPageModelImpl._setOriginalHead = false;
1068    
1069                    wikiPageModelImpl._originalParentTitle = wikiPageModelImpl._parentTitle;
1070    
1071                    wikiPageModelImpl._originalRedirectTitle = wikiPageModelImpl._redirectTitle;
1072    
1073                    wikiPageModelImpl._originalStatus = wikiPageModelImpl._status;
1074    
1075                    wikiPageModelImpl._setOriginalStatus = false;
1076    
1077                    wikiPageModelImpl._columnBitmask = 0;
1078            }
1079    
1080            @Override
1081            public CacheModel<WikiPage> toCacheModel() {
1082                    WikiPageCacheModel wikiPageCacheModel = new WikiPageCacheModel();
1083    
1084                    wikiPageCacheModel.uuid = getUuid();
1085    
1086                    String uuid = wikiPageCacheModel.uuid;
1087    
1088                    if ((uuid != null) && (uuid.length() == 0)) {
1089                            wikiPageCacheModel.uuid = null;
1090                    }
1091    
1092                    wikiPageCacheModel.pageId = getPageId();
1093    
1094                    wikiPageCacheModel.resourcePrimKey = getResourcePrimKey();
1095    
1096                    wikiPageCacheModel.groupId = getGroupId();
1097    
1098                    wikiPageCacheModel.companyId = getCompanyId();
1099    
1100                    wikiPageCacheModel.userId = getUserId();
1101    
1102                    wikiPageCacheModel.userName = getUserName();
1103    
1104                    String userName = wikiPageCacheModel.userName;
1105    
1106                    if ((userName != null) && (userName.length() == 0)) {
1107                            wikiPageCacheModel.userName = null;
1108                    }
1109    
1110                    Date createDate = getCreateDate();
1111    
1112                    if (createDate != null) {
1113                            wikiPageCacheModel.createDate = createDate.getTime();
1114                    }
1115                    else {
1116                            wikiPageCacheModel.createDate = Long.MIN_VALUE;
1117                    }
1118    
1119                    Date modifiedDate = getModifiedDate();
1120    
1121                    if (modifiedDate != null) {
1122                            wikiPageCacheModel.modifiedDate = modifiedDate.getTime();
1123                    }
1124                    else {
1125                            wikiPageCacheModel.modifiedDate = Long.MIN_VALUE;
1126                    }
1127    
1128                    wikiPageCacheModel.nodeId = getNodeId();
1129    
1130                    wikiPageCacheModel.title = getTitle();
1131    
1132                    String title = wikiPageCacheModel.title;
1133    
1134                    if ((title != null) && (title.length() == 0)) {
1135                            wikiPageCacheModel.title = null;
1136                    }
1137    
1138                    wikiPageCacheModel.version = getVersion();
1139    
1140                    wikiPageCacheModel.minorEdit = getMinorEdit();
1141    
1142                    wikiPageCacheModel.content = getContent();
1143    
1144                    String content = wikiPageCacheModel.content;
1145    
1146                    if ((content != null) && (content.length() == 0)) {
1147                            wikiPageCacheModel.content = null;
1148                    }
1149    
1150                    wikiPageCacheModel.summary = getSummary();
1151    
1152                    String summary = wikiPageCacheModel.summary;
1153    
1154                    if ((summary != null) && (summary.length() == 0)) {
1155                            wikiPageCacheModel.summary = null;
1156                    }
1157    
1158                    wikiPageCacheModel.format = getFormat();
1159    
1160                    String format = wikiPageCacheModel.format;
1161    
1162                    if ((format != null) && (format.length() == 0)) {
1163                            wikiPageCacheModel.format = null;
1164                    }
1165    
1166                    wikiPageCacheModel.head = getHead();
1167    
1168                    wikiPageCacheModel.parentTitle = getParentTitle();
1169    
1170                    String parentTitle = wikiPageCacheModel.parentTitle;
1171    
1172                    if ((parentTitle != null) && (parentTitle.length() == 0)) {
1173                            wikiPageCacheModel.parentTitle = null;
1174                    }
1175    
1176                    wikiPageCacheModel.redirectTitle = getRedirectTitle();
1177    
1178                    String redirectTitle = wikiPageCacheModel.redirectTitle;
1179    
1180                    if ((redirectTitle != null) && (redirectTitle.length() == 0)) {
1181                            wikiPageCacheModel.redirectTitle = null;
1182                    }
1183    
1184                    wikiPageCacheModel.status = getStatus();
1185    
1186                    wikiPageCacheModel.statusByUserId = getStatusByUserId();
1187    
1188                    wikiPageCacheModel.statusByUserName = getStatusByUserName();
1189    
1190                    String statusByUserName = wikiPageCacheModel.statusByUserName;
1191    
1192                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
1193                            wikiPageCacheModel.statusByUserName = null;
1194                    }
1195    
1196                    Date statusDate = getStatusDate();
1197    
1198                    if (statusDate != null) {
1199                            wikiPageCacheModel.statusDate = statusDate.getTime();
1200                    }
1201                    else {
1202                            wikiPageCacheModel.statusDate = Long.MIN_VALUE;
1203                    }
1204    
1205                    return wikiPageCacheModel;
1206            }
1207    
1208            @Override
1209            public String toString() {
1210                    StringBundler sb = new StringBundler(47);
1211    
1212                    sb.append("{uuid=");
1213                    sb.append(getUuid());
1214                    sb.append(", pageId=");
1215                    sb.append(getPageId());
1216                    sb.append(", resourcePrimKey=");
1217                    sb.append(getResourcePrimKey());
1218                    sb.append(", groupId=");
1219                    sb.append(getGroupId());
1220                    sb.append(", companyId=");
1221                    sb.append(getCompanyId());
1222                    sb.append(", userId=");
1223                    sb.append(getUserId());
1224                    sb.append(", userName=");
1225                    sb.append(getUserName());
1226                    sb.append(", createDate=");
1227                    sb.append(getCreateDate());
1228                    sb.append(", modifiedDate=");
1229                    sb.append(getModifiedDate());
1230                    sb.append(", nodeId=");
1231                    sb.append(getNodeId());
1232                    sb.append(", title=");
1233                    sb.append(getTitle());
1234                    sb.append(", version=");
1235                    sb.append(getVersion());
1236                    sb.append(", minorEdit=");
1237                    sb.append(getMinorEdit());
1238                    sb.append(", content=");
1239                    sb.append(getContent());
1240                    sb.append(", summary=");
1241                    sb.append(getSummary());
1242                    sb.append(", format=");
1243                    sb.append(getFormat());
1244                    sb.append(", head=");
1245                    sb.append(getHead());
1246                    sb.append(", parentTitle=");
1247                    sb.append(getParentTitle());
1248                    sb.append(", redirectTitle=");
1249                    sb.append(getRedirectTitle());
1250                    sb.append(", status=");
1251                    sb.append(getStatus());
1252                    sb.append(", statusByUserId=");
1253                    sb.append(getStatusByUserId());
1254                    sb.append(", statusByUserName=");
1255                    sb.append(getStatusByUserName());
1256                    sb.append(", statusDate=");
1257                    sb.append(getStatusDate());
1258                    sb.append("}");
1259    
1260                    return sb.toString();
1261            }
1262    
1263            public String toXmlString() {
1264                    StringBundler sb = new StringBundler(73);
1265    
1266                    sb.append("<model><model-name>");
1267                    sb.append("com.liferay.portlet.wiki.model.WikiPage");
1268                    sb.append("</model-name>");
1269    
1270                    sb.append(
1271                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1272                    sb.append(getUuid());
1273                    sb.append("]]></column-value></column>");
1274                    sb.append(
1275                            "<column><column-name>pageId</column-name><column-value><![CDATA[");
1276                    sb.append(getPageId());
1277                    sb.append("]]></column-value></column>");
1278                    sb.append(
1279                            "<column><column-name>resourcePrimKey</column-name><column-value><![CDATA[");
1280                    sb.append(getResourcePrimKey());
1281                    sb.append("]]></column-value></column>");
1282                    sb.append(
1283                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1284                    sb.append(getGroupId());
1285                    sb.append("]]></column-value></column>");
1286                    sb.append(
1287                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1288                    sb.append(getCompanyId());
1289                    sb.append("]]></column-value></column>");
1290                    sb.append(
1291                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1292                    sb.append(getUserId());
1293                    sb.append("]]></column-value></column>");
1294                    sb.append(
1295                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1296                    sb.append(getUserName());
1297                    sb.append("]]></column-value></column>");
1298                    sb.append(
1299                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1300                    sb.append(getCreateDate());
1301                    sb.append("]]></column-value></column>");
1302                    sb.append(
1303                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1304                    sb.append(getModifiedDate());
1305                    sb.append("]]></column-value></column>");
1306                    sb.append(
1307                            "<column><column-name>nodeId</column-name><column-value><![CDATA[");
1308                    sb.append(getNodeId());
1309                    sb.append("]]></column-value></column>");
1310                    sb.append(
1311                            "<column><column-name>title</column-name><column-value><![CDATA[");
1312                    sb.append(getTitle());
1313                    sb.append("]]></column-value></column>");
1314                    sb.append(
1315                            "<column><column-name>version</column-name><column-value><![CDATA[");
1316                    sb.append(getVersion());
1317                    sb.append("]]></column-value></column>");
1318                    sb.append(
1319                            "<column><column-name>minorEdit</column-name><column-value><![CDATA[");
1320                    sb.append(getMinorEdit());
1321                    sb.append("]]></column-value></column>");
1322                    sb.append(
1323                            "<column><column-name>content</column-name><column-value><![CDATA[");
1324                    sb.append(getContent());
1325                    sb.append("]]></column-value></column>");
1326                    sb.append(
1327                            "<column><column-name>summary</column-name><column-value><![CDATA[");
1328                    sb.append(getSummary());
1329                    sb.append("]]></column-value></column>");
1330                    sb.append(
1331                            "<column><column-name>format</column-name><column-value><![CDATA[");
1332                    sb.append(getFormat());
1333                    sb.append("]]></column-value></column>");
1334                    sb.append(
1335                            "<column><column-name>head</column-name><column-value><![CDATA[");
1336                    sb.append(getHead());
1337                    sb.append("]]></column-value></column>");
1338                    sb.append(
1339                            "<column><column-name>parentTitle</column-name><column-value><![CDATA[");
1340                    sb.append(getParentTitle());
1341                    sb.append("]]></column-value></column>");
1342                    sb.append(
1343                            "<column><column-name>redirectTitle</column-name><column-value><![CDATA[");
1344                    sb.append(getRedirectTitle());
1345                    sb.append("]]></column-value></column>");
1346                    sb.append(
1347                            "<column><column-name>status</column-name><column-value><![CDATA[");
1348                    sb.append(getStatus());
1349                    sb.append("]]></column-value></column>");
1350                    sb.append(
1351                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1352                    sb.append(getStatusByUserId());
1353                    sb.append("]]></column-value></column>");
1354                    sb.append(
1355                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1356                    sb.append(getStatusByUserName());
1357                    sb.append("]]></column-value></column>");
1358                    sb.append(
1359                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1360                    sb.append(getStatusDate());
1361                    sb.append("]]></column-value></column>");
1362    
1363                    sb.append("</model>");
1364    
1365                    return sb.toString();
1366            }
1367    
1368            private static ClassLoader _classLoader = WikiPage.class.getClassLoader();
1369            private static Class<?>[] _escapedModelInterfaces = new Class[] {
1370                            WikiPage.class
1371                    };
1372            private String _uuid;
1373            private String _originalUuid;
1374            private long _pageId;
1375            private long _resourcePrimKey;
1376            private long _originalResourcePrimKey;
1377            private boolean _setOriginalResourcePrimKey;
1378            private long _groupId;
1379            private long _originalGroupId;
1380            private boolean _setOriginalGroupId;
1381            private long _companyId;
1382            private long _originalCompanyId;
1383            private boolean _setOriginalCompanyId;
1384            private long _userId;
1385            private String _userUuid;
1386            private long _originalUserId;
1387            private boolean _setOriginalUserId;
1388            private String _userName;
1389            private Date _createDate;
1390            private Date _modifiedDate;
1391            private long _nodeId;
1392            private long _originalNodeId;
1393            private boolean _setOriginalNodeId;
1394            private String _title;
1395            private String _originalTitle;
1396            private double _version;
1397            private double _originalVersion;
1398            private boolean _setOriginalVersion;
1399            private boolean _minorEdit;
1400            private String _content;
1401            private String _summary;
1402            private String _format;
1403            private String _originalFormat;
1404            private boolean _head;
1405            private boolean _originalHead;
1406            private boolean _setOriginalHead;
1407            private String _parentTitle;
1408            private String _originalParentTitle;
1409            private String _redirectTitle;
1410            private String _originalRedirectTitle;
1411            private int _status;
1412            private int _originalStatus;
1413            private boolean _setOriginalStatus;
1414            private long _statusByUserId;
1415            private String _statusByUserUuid;
1416            private String _statusByUserName;
1417            private Date _statusDate;
1418            private long _columnBitmask;
1419            private WikiPage _escapedModel;
1420    }