001    /**
002     * Copyright (c) 2000-2013 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.journal.model.impl;
016    
017    import com.liferay.portal.LocaleException;
018    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.json.JSON;
021    import com.liferay.portal.kernel.language.LanguageUtil;
022    import com.liferay.portal.kernel.util.GetterUtil;
023    import com.liferay.portal.kernel.util.LocaleUtil;
024    import com.liferay.portal.kernel.util.LocalizationUtil;
025    import com.liferay.portal.kernel.util.ProxyUtil;
026    import com.liferay.portal.kernel.util.StringBundler;
027    import com.liferay.portal.kernel.util.StringPool;
028    import com.liferay.portal.kernel.util.Validator;
029    import com.liferay.portal.kernel.workflow.WorkflowConstants;
030    import com.liferay.portal.model.CacheModel;
031    import com.liferay.portal.model.impl.BaseModelImpl;
032    import com.liferay.portal.service.ServiceContext;
033    import com.liferay.portal.util.PortalUtil;
034    
035    import com.liferay.portlet.expando.model.ExpandoBridge;
036    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
037    import com.liferay.portlet.journal.model.JournalArticle;
038    import com.liferay.portlet.journal.model.JournalArticleModel;
039    import com.liferay.portlet.journal.model.JournalArticleSoap;
040    
041    import java.io.Serializable;
042    
043    import java.sql.Types;
044    
045    import java.util.ArrayList;
046    import java.util.Date;
047    import java.util.HashMap;
048    import java.util.List;
049    import java.util.Locale;
050    import java.util.Map;
051    
052    /**
053     * The base model implementation for the JournalArticle service. Represents a row in the "JournalArticle" database table, with each column mapped to a property of this class.
054     *
055     * <p>
056     * This implementation and its corresponding interface {@link com.liferay.portlet.journal.model.JournalArticleModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link JournalArticleImpl}.
057     * </p>
058     *
059     * @author Brian Wing Shun Chan
060     * @see JournalArticleImpl
061     * @see com.liferay.portlet.journal.model.JournalArticle
062     * @see com.liferay.portlet.journal.model.JournalArticleModel
063     * @generated
064     */
065    @JSON(strict = true)
066    public class JournalArticleModelImpl extends BaseModelImpl<JournalArticle>
067            implements JournalArticleModel {
068            /*
069             * NOTE FOR DEVELOPERS:
070             *
071             * Never modify or reference this class directly. All methods that expect a journal article model instance should use the {@link com.liferay.portlet.journal.model.JournalArticle} interface instead.
072             */
073            public static final String TABLE_NAME = "JournalArticle";
074            public static final Object[][] TABLE_COLUMNS = {
075                            { "uuid_", Types.VARCHAR },
076                            { "id_", Types.BIGINT },
077                            { "resourcePrimKey", Types.BIGINT },
078                            { "groupId", Types.BIGINT },
079                            { "companyId", Types.BIGINT },
080                            { "userId", Types.BIGINT },
081                            { "userName", Types.VARCHAR },
082                            { "createDate", Types.TIMESTAMP },
083                            { "modifiedDate", Types.TIMESTAMP },
084                            { "classNameId", Types.BIGINT },
085                            { "classPK", Types.BIGINT },
086                            { "articleId", Types.VARCHAR },
087                            { "version", Types.DOUBLE },
088                            { "title", Types.VARCHAR },
089                            { "urlTitle", Types.VARCHAR },
090                            { "description", Types.VARCHAR },
091                            { "content", Types.CLOB },
092                            { "type_", Types.VARCHAR },
093                            { "structureId", Types.VARCHAR },
094                            { "templateId", Types.VARCHAR },
095                            { "layoutUuid", Types.VARCHAR },
096                            { "displayDate", Types.TIMESTAMP },
097                            { "expirationDate", Types.TIMESTAMP },
098                            { "reviewDate", Types.TIMESTAMP },
099                            { "indexable", Types.BOOLEAN },
100                            { "smallImage", Types.BOOLEAN },
101                            { "smallImageId", Types.BIGINT },
102                            { "smallImageURL", Types.VARCHAR },
103                            { "status", Types.INTEGER },
104                            { "statusByUserId", Types.BIGINT },
105                            { "statusByUserName", Types.VARCHAR },
106                            { "statusDate", Types.TIMESTAMP }
107                    };
108            public static final String TABLE_SQL_CREATE = "create table JournalArticle (uuid_ VARCHAR(75) null,id_ LONG not null primary key,resourcePrimKey LONG,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,classNameId LONG,classPK LONG,articleId VARCHAR(75) null,version DOUBLE,title STRING null,urlTitle VARCHAR(150) null,description STRING null,content TEXT null,type_ VARCHAR(75) null,structureId VARCHAR(75) null,templateId VARCHAR(75) null,layoutUuid VARCHAR(75) null,displayDate DATE null,expirationDate DATE null,reviewDate DATE null,indexable BOOLEAN,smallImage BOOLEAN,smallImageId LONG,smallImageURL STRING null,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
109            public static final String TABLE_SQL_DROP = "drop table JournalArticle";
110            public static final String ORDER_BY_JPQL = " ORDER BY journalArticle.articleId ASC, journalArticle.version DESC";
111            public static final String ORDER_BY_SQL = " ORDER BY JournalArticle.articleId ASC, JournalArticle.version DESC";
112            public static final String DATA_SOURCE = "liferayDataSource";
113            public static final String SESSION_FACTORY = "liferaySessionFactory";
114            public static final String TX_MANAGER = "liferayTransactionManager";
115            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
116                                    "value.object.entity.cache.enabled.com.liferay.portlet.journal.model.JournalArticle"),
117                            true);
118            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
119                                    "value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalArticle"),
120                            true);
121            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
122                                    "value.object.column.bitmask.enabled.com.liferay.portlet.journal.model.JournalArticle"),
123                            true);
124            public static long ARTICLEID_COLUMN_BITMASK = 1L;
125            public static long CLASSNAMEID_COLUMN_BITMASK = 2L;
126            public static long CLASSPK_COLUMN_BITMASK = 4L;
127            public static long COMPANYID_COLUMN_BITMASK = 8L;
128            public static long GROUPID_COLUMN_BITMASK = 16L;
129            public static long LAYOUTUUID_COLUMN_BITMASK = 32L;
130            public static long RESOURCEPRIMKEY_COLUMN_BITMASK = 64L;
131            public static long SMALLIMAGEID_COLUMN_BITMASK = 128L;
132            public static long STATUS_COLUMN_BITMASK = 256L;
133            public static long STRUCTUREID_COLUMN_BITMASK = 512L;
134            public static long TEMPLATEID_COLUMN_BITMASK = 1024L;
135            public static long URLTITLE_COLUMN_BITMASK = 2048L;
136            public static long UUID_COLUMN_BITMASK = 4096L;
137            public static long VERSION_COLUMN_BITMASK = 8192L;
138    
139            /**
140             * Converts the soap model instance into a normal model instance.
141             *
142             * @param soapModel the soap model instance to convert
143             * @return the normal model instance
144             */
145            public static JournalArticle toModel(JournalArticleSoap soapModel) {
146                    if (soapModel == null) {
147                            return null;
148                    }
149    
150                    JournalArticle model = new JournalArticleImpl();
151    
152                    model.setUuid(soapModel.getUuid());
153                    model.setId(soapModel.getId());
154                    model.setResourcePrimKey(soapModel.getResourcePrimKey());
155                    model.setGroupId(soapModel.getGroupId());
156                    model.setCompanyId(soapModel.getCompanyId());
157                    model.setUserId(soapModel.getUserId());
158                    model.setUserName(soapModel.getUserName());
159                    model.setCreateDate(soapModel.getCreateDate());
160                    model.setModifiedDate(soapModel.getModifiedDate());
161                    model.setClassNameId(soapModel.getClassNameId());
162                    model.setClassPK(soapModel.getClassPK());
163                    model.setArticleId(soapModel.getArticleId());
164                    model.setVersion(soapModel.getVersion());
165                    model.setTitle(soapModel.getTitle());
166                    model.setUrlTitle(soapModel.getUrlTitle());
167                    model.setDescription(soapModel.getDescription());
168                    model.setContent(soapModel.getContent());
169                    model.setType(soapModel.getType());
170                    model.setStructureId(soapModel.getStructureId());
171                    model.setTemplateId(soapModel.getTemplateId());
172                    model.setLayoutUuid(soapModel.getLayoutUuid());
173                    model.setDisplayDate(soapModel.getDisplayDate());
174                    model.setExpirationDate(soapModel.getExpirationDate());
175                    model.setReviewDate(soapModel.getReviewDate());
176                    model.setIndexable(soapModel.getIndexable());
177                    model.setSmallImage(soapModel.getSmallImage());
178                    model.setSmallImageId(soapModel.getSmallImageId());
179                    model.setSmallImageURL(soapModel.getSmallImageURL());
180                    model.setStatus(soapModel.getStatus());
181                    model.setStatusByUserId(soapModel.getStatusByUserId());
182                    model.setStatusByUserName(soapModel.getStatusByUserName());
183                    model.setStatusDate(soapModel.getStatusDate());
184    
185                    return model;
186            }
187    
188            /**
189             * Converts the soap model instances into normal model instances.
190             *
191             * @param soapModels the soap model instances to convert
192             * @return the normal model instances
193             */
194            public static List<JournalArticle> toModels(JournalArticleSoap[] soapModels) {
195                    if (soapModels == null) {
196                            return null;
197                    }
198    
199                    List<JournalArticle> models = new ArrayList<JournalArticle>(soapModels.length);
200    
201                    for (JournalArticleSoap soapModel : soapModels) {
202                            models.add(toModel(soapModel));
203                    }
204    
205                    return models;
206            }
207    
208            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
209                                    "lock.expiration.time.com.liferay.portlet.journal.model.JournalArticle"));
210    
211            public JournalArticleModelImpl() {
212            }
213    
214            public long getPrimaryKey() {
215                    return _id;
216            }
217    
218            public void setPrimaryKey(long primaryKey) {
219                    setId(primaryKey);
220            }
221    
222            public Serializable getPrimaryKeyObj() {
223                    return new Long(_id);
224            }
225    
226            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
227                    setPrimaryKey(((Long)primaryKeyObj).longValue());
228            }
229    
230            public Class<?> getModelClass() {
231                    return JournalArticle.class;
232            }
233    
234            public String getModelClassName() {
235                    return JournalArticle.class.getName();
236            }
237    
238            @Override
239            public Map<String, Object> getModelAttributes() {
240                    Map<String, Object> attributes = new HashMap<String, Object>();
241    
242                    attributes.put("uuid", getUuid());
243                    attributes.put("id", getId());
244                    attributes.put("resourcePrimKey", getResourcePrimKey());
245                    attributes.put("groupId", getGroupId());
246                    attributes.put("companyId", getCompanyId());
247                    attributes.put("userId", getUserId());
248                    attributes.put("userName", getUserName());
249                    attributes.put("createDate", getCreateDate());
250                    attributes.put("modifiedDate", getModifiedDate());
251                    attributes.put("classNameId", getClassNameId());
252                    attributes.put("classPK", getClassPK());
253                    attributes.put("articleId", getArticleId());
254                    attributes.put("version", getVersion());
255                    attributes.put("title", getTitle());
256                    attributes.put("urlTitle", getUrlTitle());
257                    attributes.put("description", getDescription());
258                    attributes.put("content", getContent());
259                    attributes.put("type", getType());
260                    attributes.put("structureId", getStructureId());
261                    attributes.put("templateId", getTemplateId());
262                    attributes.put("layoutUuid", getLayoutUuid());
263                    attributes.put("displayDate", getDisplayDate());
264                    attributes.put("expirationDate", getExpirationDate());
265                    attributes.put("reviewDate", getReviewDate());
266                    attributes.put("indexable", getIndexable());
267                    attributes.put("smallImage", getSmallImage());
268                    attributes.put("smallImageId", getSmallImageId());
269                    attributes.put("smallImageURL", getSmallImageURL());
270                    attributes.put("status", getStatus());
271                    attributes.put("statusByUserId", getStatusByUserId());
272                    attributes.put("statusByUserName", getStatusByUserName());
273                    attributes.put("statusDate", getStatusDate());
274    
275                    return attributes;
276            }
277    
278            @Override
279            public void setModelAttributes(Map<String, Object> attributes) {
280                    String uuid = (String)attributes.get("uuid");
281    
282                    if (uuid != null) {
283                            setUuid(uuid);
284                    }
285    
286                    Long id = (Long)attributes.get("id");
287    
288                    if (id != null) {
289                            setId(id);
290                    }
291    
292                    Long resourcePrimKey = (Long)attributes.get("resourcePrimKey");
293    
294                    if (resourcePrimKey != null) {
295                            setResourcePrimKey(resourcePrimKey);
296                    }
297    
298                    Long groupId = (Long)attributes.get("groupId");
299    
300                    if (groupId != null) {
301                            setGroupId(groupId);
302                    }
303    
304                    Long companyId = (Long)attributes.get("companyId");
305    
306                    if (companyId != null) {
307                            setCompanyId(companyId);
308                    }
309    
310                    Long userId = (Long)attributes.get("userId");
311    
312                    if (userId != null) {
313                            setUserId(userId);
314                    }
315    
316                    String userName = (String)attributes.get("userName");
317    
318                    if (userName != null) {
319                            setUserName(userName);
320                    }
321    
322                    Date createDate = (Date)attributes.get("createDate");
323    
324                    if (createDate != null) {
325                            setCreateDate(createDate);
326                    }
327    
328                    Date modifiedDate = (Date)attributes.get("modifiedDate");
329    
330                    if (modifiedDate != null) {
331                            setModifiedDate(modifiedDate);
332                    }
333    
334                    Long classNameId = (Long)attributes.get("classNameId");
335    
336                    if (classNameId != null) {
337                            setClassNameId(classNameId);
338                    }
339    
340                    Long classPK = (Long)attributes.get("classPK");
341    
342                    if (classPK != null) {
343                            setClassPK(classPK);
344                    }
345    
346                    String articleId = (String)attributes.get("articleId");
347    
348                    if (articleId != null) {
349                            setArticleId(articleId);
350                    }
351    
352                    Double version = (Double)attributes.get("version");
353    
354                    if (version != null) {
355                            setVersion(version);
356                    }
357    
358                    String title = (String)attributes.get("title");
359    
360                    if (title != null) {
361                            setTitle(title);
362                    }
363    
364                    String urlTitle = (String)attributes.get("urlTitle");
365    
366                    if (urlTitle != null) {
367                            setUrlTitle(urlTitle);
368                    }
369    
370                    String description = (String)attributes.get("description");
371    
372                    if (description != null) {
373                            setDescription(description);
374                    }
375    
376                    String content = (String)attributes.get("content");
377    
378                    if (content != null) {
379                            setContent(content);
380                    }
381    
382                    String type = (String)attributes.get("type");
383    
384                    if (type != null) {
385                            setType(type);
386                    }
387    
388                    String structureId = (String)attributes.get("structureId");
389    
390                    if (structureId != null) {
391                            setStructureId(structureId);
392                    }
393    
394                    String templateId = (String)attributes.get("templateId");
395    
396                    if (templateId != null) {
397                            setTemplateId(templateId);
398                    }
399    
400                    String layoutUuid = (String)attributes.get("layoutUuid");
401    
402                    if (layoutUuid != null) {
403                            setLayoutUuid(layoutUuid);
404                    }
405    
406                    Date displayDate = (Date)attributes.get("displayDate");
407    
408                    if (displayDate != null) {
409                            setDisplayDate(displayDate);
410                    }
411    
412                    Date expirationDate = (Date)attributes.get("expirationDate");
413    
414                    if (expirationDate != null) {
415                            setExpirationDate(expirationDate);
416                    }
417    
418                    Date reviewDate = (Date)attributes.get("reviewDate");
419    
420                    if (reviewDate != null) {
421                            setReviewDate(reviewDate);
422                    }
423    
424                    Boolean indexable = (Boolean)attributes.get("indexable");
425    
426                    if (indexable != null) {
427                            setIndexable(indexable);
428                    }
429    
430                    Boolean smallImage = (Boolean)attributes.get("smallImage");
431    
432                    if (smallImage != null) {
433                            setSmallImage(smallImage);
434                    }
435    
436                    Long smallImageId = (Long)attributes.get("smallImageId");
437    
438                    if (smallImageId != null) {
439                            setSmallImageId(smallImageId);
440                    }
441    
442                    String smallImageURL = (String)attributes.get("smallImageURL");
443    
444                    if (smallImageURL != null) {
445                            setSmallImageURL(smallImageURL);
446                    }
447    
448                    Integer status = (Integer)attributes.get("status");
449    
450                    if (status != null) {
451                            setStatus(status);
452                    }
453    
454                    Long statusByUserId = (Long)attributes.get("statusByUserId");
455    
456                    if (statusByUserId != null) {
457                            setStatusByUserId(statusByUserId);
458                    }
459    
460                    String statusByUserName = (String)attributes.get("statusByUserName");
461    
462                    if (statusByUserName != null) {
463                            setStatusByUserName(statusByUserName);
464                    }
465    
466                    Date statusDate = (Date)attributes.get("statusDate");
467    
468                    if (statusDate != null) {
469                            setStatusDate(statusDate);
470                    }
471            }
472    
473            @JSON
474            public String getUuid() {
475                    if (_uuid == null) {
476                            return StringPool.BLANK;
477                    }
478                    else {
479                            return _uuid;
480                    }
481            }
482    
483            public void setUuid(String uuid) {
484                    if (_originalUuid == null) {
485                            _originalUuid = _uuid;
486                    }
487    
488                    _uuid = uuid;
489            }
490    
491            public String getOriginalUuid() {
492                    return GetterUtil.getString(_originalUuid);
493            }
494    
495            @JSON
496            public long getId() {
497                    return _id;
498            }
499    
500            public void setId(long id) {
501                    _id = id;
502            }
503    
504            @JSON
505            public long getResourcePrimKey() {
506                    return _resourcePrimKey;
507            }
508    
509            public void setResourcePrimKey(long resourcePrimKey) {
510                    _columnBitmask |= RESOURCEPRIMKEY_COLUMN_BITMASK;
511    
512                    if (!_setOriginalResourcePrimKey) {
513                            _setOriginalResourcePrimKey = true;
514    
515                            _originalResourcePrimKey = _resourcePrimKey;
516                    }
517    
518                    _resourcePrimKey = resourcePrimKey;
519            }
520    
521            public boolean isResourceMain() {
522                    return true;
523            }
524    
525            public long getOriginalResourcePrimKey() {
526                    return _originalResourcePrimKey;
527            }
528    
529            @JSON
530            public long getGroupId() {
531                    return _groupId;
532            }
533    
534            public void setGroupId(long groupId) {
535                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
536    
537                    if (!_setOriginalGroupId) {
538                            _setOriginalGroupId = true;
539    
540                            _originalGroupId = _groupId;
541                    }
542    
543                    _groupId = groupId;
544            }
545    
546            public long getOriginalGroupId() {
547                    return _originalGroupId;
548            }
549    
550            @JSON
551            public long getCompanyId() {
552                    return _companyId;
553            }
554    
555            public void setCompanyId(long companyId) {
556                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
557    
558                    if (!_setOriginalCompanyId) {
559                            _setOriginalCompanyId = true;
560    
561                            _originalCompanyId = _companyId;
562                    }
563    
564                    _companyId = companyId;
565            }
566    
567            public long getOriginalCompanyId() {
568                    return _originalCompanyId;
569            }
570    
571            @JSON
572            public long getUserId() {
573                    return _userId;
574            }
575    
576            public void setUserId(long userId) {
577                    _userId = userId;
578            }
579    
580            public String getUserUuid() throws SystemException {
581                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
582            }
583    
584            public void setUserUuid(String userUuid) {
585                    _userUuid = userUuid;
586            }
587    
588            @JSON
589            public String getUserName() {
590                    if (_userName == null) {
591                            return StringPool.BLANK;
592                    }
593                    else {
594                            return _userName;
595                    }
596            }
597    
598            public void setUserName(String userName) {
599                    _userName = userName;
600            }
601    
602            @JSON
603            public Date getCreateDate() {
604                    return _createDate;
605            }
606    
607            public void setCreateDate(Date createDate) {
608                    _createDate = createDate;
609            }
610    
611            @JSON
612            public Date getModifiedDate() {
613                    return _modifiedDate;
614            }
615    
616            public void setModifiedDate(Date modifiedDate) {
617                    _modifiedDate = modifiedDate;
618            }
619    
620            public String getClassName() {
621                    if (getClassNameId() <= 0) {
622                            return StringPool.BLANK;
623                    }
624    
625                    return PortalUtil.getClassName(getClassNameId());
626            }
627    
628            public void setClassName(String className) {
629                    long classNameId = 0;
630    
631                    if (Validator.isNotNull(className)) {
632                            classNameId = PortalUtil.getClassNameId(className);
633                    }
634    
635                    setClassNameId(classNameId);
636            }
637    
638            @JSON
639            public long getClassNameId() {
640                    return _classNameId;
641            }
642    
643            public void setClassNameId(long classNameId) {
644                    _columnBitmask |= CLASSNAMEID_COLUMN_BITMASK;
645    
646                    if (!_setOriginalClassNameId) {
647                            _setOriginalClassNameId = true;
648    
649                            _originalClassNameId = _classNameId;
650                    }
651    
652                    _classNameId = classNameId;
653            }
654    
655            public long getOriginalClassNameId() {
656                    return _originalClassNameId;
657            }
658    
659            @JSON
660            public long getClassPK() {
661                    return _classPK;
662            }
663    
664            public void setClassPK(long classPK) {
665                    _columnBitmask |= CLASSPK_COLUMN_BITMASK;
666    
667                    if (!_setOriginalClassPK) {
668                            _setOriginalClassPK = true;
669    
670                            _originalClassPK = _classPK;
671                    }
672    
673                    _classPK = classPK;
674            }
675    
676            public long getOriginalClassPK() {
677                    return _originalClassPK;
678            }
679    
680            @JSON
681            public String getArticleId() {
682                    if (_articleId == null) {
683                            return StringPool.BLANK;
684                    }
685                    else {
686                            return _articleId;
687                    }
688            }
689    
690            public void setArticleId(String articleId) {
691                    _columnBitmask = -1L;
692    
693                    if (_originalArticleId == null) {
694                            _originalArticleId = _articleId;
695                    }
696    
697                    _articleId = articleId;
698            }
699    
700            public String getOriginalArticleId() {
701                    return GetterUtil.getString(_originalArticleId);
702            }
703    
704            @JSON
705            public double getVersion() {
706                    return _version;
707            }
708    
709            public void setVersion(double version) {
710                    _columnBitmask = -1L;
711    
712                    if (!_setOriginalVersion) {
713                            _setOriginalVersion = true;
714    
715                            _originalVersion = _version;
716                    }
717    
718                    _version = version;
719            }
720    
721            public double getOriginalVersion() {
722                    return _originalVersion;
723            }
724    
725            @JSON
726            public String getTitle() {
727                    if (_title == null) {
728                            return StringPool.BLANK;
729                    }
730                    else {
731                            return _title;
732                    }
733            }
734    
735            public String getTitle(Locale locale) {
736                    String languageId = LocaleUtil.toLanguageId(locale);
737    
738                    return getTitle(languageId);
739            }
740    
741            public String getTitle(Locale locale, boolean useDefault) {
742                    String languageId = LocaleUtil.toLanguageId(locale);
743    
744                    return getTitle(languageId, useDefault);
745            }
746    
747            public String getTitle(String languageId) {
748                    return LocalizationUtil.getLocalization(getTitle(), languageId);
749            }
750    
751            public String getTitle(String languageId, boolean useDefault) {
752                    return LocalizationUtil.getLocalization(getTitle(), languageId,
753                            useDefault);
754            }
755    
756            public String getTitleCurrentLanguageId() {
757                    return _titleCurrentLanguageId;
758            }
759    
760            @JSON
761            public String getTitleCurrentValue() {
762                    Locale locale = getLocale(_titleCurrentLanguageId);
763    
764                    return getTitle(locale);
765            }
766    
767            public Map<Locale, String> getTitleMap() {
768                    return LocalizationUtil.getLocalizationMap(getTitle());
769            }
770    
771            public void setTitle(String title) {
772                    _title = title;
773            }
774    
775            public void setTitle(String title, Locale locale) {
776                    setTitle(title, locale, LocaleUtil.getDefault());
777            }
778    
779            public void setTitle(String title, Locale locale, Locale defaultLocale) {
780                    String languageId = LocaleUtil.toLanguageId(locale);
781                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
782    
783                    if (Validator.isNotNull(title)) {
784                            setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
785                                            title, languageId, defaultLanguageId));
786                    }
787                    else {
788                            setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
789                                            languageId));
790                    }
791            }
792    
793            public void setTitleCurrentLanguageId(String languageId) {
794                    _titleCurrentLanguageId = languageId;
795            }
796    
797            public void setTitleMap(Map<Locale, String> titleMap) {
798                    setTitleMap(titleMap, LocaleUtil.getDefault());
799            }
800    
801            public void setTitleMap(Map<Locale, String> titleMap, Locale defaultLocale) {
802                    if (titleMap == null) {
803                            return;
804                    }
805    
806                    Locale[] locales = LanguageUtil.getAvailableLocales();
807    
808                    for (Locale locale : locales) {
809                            String title = titleMap.get(locale);
810    
811                            setTitle(title, locale, defaultLocale);
812                    }
813            }
814    
815            @JSON
816            public String getUrlTitle() {
817                    if (_urlTitle == null) {
818                            return StringPool.BLANK;
819                    }
820                    else {
821                            return _urlTitle;
822                    }
823            }
824    
825            public void setUrlTitle(String urlTitle) {
826                    _columnBitmask |= URLTITLE_COLUMN_BITMASK;
827    
828                    if (_originalUrlTitle == null) {
829                            _originalUrlTitle = _urlTitle;
830                    }
831    
832                    _urlTitle = urlTitle;
833            }
834    
835            public String getOriginalUrlTitle() {
836                    return GetterUtil.getString(_originalUrlTitle);
837            }
838    
839            @JSON
840            public String getDescription() {
841                    if (_description == null) {
842                            return StringPool.BLANK;
843                    }
844                    else {
845                            return _description;
846                    }
847            }
848    
849            public String getDescription(Locale locale) {
850                    String languageId = LocaleUtil.toLanguageId(locale);
851    
852                    return getDescription(languageId);
853            }
854    
855            public String getDescription(Locale locale, boolean useDefault) {
856                    String languageId = LocaleUtil.toLanguageId(locale);
857    
858                    return getDescription(languageId, useDefault);
859            }
860    
861            public String getDescription(String languageId) {
862                    return LocalizationUtil.getLocalization(getDescription(), languageId);
863            }
864    
865            public String getDescription(String languageId, boolean useDefault) {
866                    return LocalizationUtil.getLocalization(getDescription(), languageId,
867                            useDefault);
868            }
869    
870            public String getDescriptionCurrentLanguageId() {
871                    return _descriptionCurrentLanguageId;
872            }
873    
874            @JSON
875            public String getDescriptionCurrentValue() {
876                    Locale locale = getLocale(_descriptionCurrentLanguageId);
877    
878                    return getDescription(locale);
879            }
880    
881            public Map<Locale, String> getDescriptionMap() {
882                    return LocalizationUtil.getLocalizationMap(getDescription());
883            }
884    
885            public void setDescription(String description) {
886                    _description = description;
887            }
888    
889            public void setDescription(String description, Locale locale) {
890                    setDescription(description, locale, LocaleUtil.getDefault());
891            }
892    
893            public void setDescription(String description, Locale locale,
894                    Locale defaultLocale) {
895                    String languageId = LocaleUtil.toLanguageId(locale);
896                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
897    
898                    if (Validator.isNotNull(description)) {
899                            setDescription(LocalizationUtil.updateLocalization(
900                                            getDescription(), "Description", description, languageId,
901                                            defaultLanguageId));
902                    }
903                    else {
904                            setDescription(LocalizationUtil.removeLocalization(
905                                            getDescription(), "Description", languageId));
906                    }
907            }
908    
909            public void setDescriptionCurrentLanguageId(String languageId) {
910                    _descriptionCurrentLanguageId = languageId;
911            }
912    
913            public void setDescriptionMap(Map<Locale, String> descriptionMap) {
914                    setDescriptionMap(descriptionMap, LocaleUtil.getDefault());
915            }
916    
917            public void setDescriptionMap(Map<Locale, String> descriptionMap,
918                    Locale defaultLocale) {
919                    if (descriptionMap == null) {
920                            return;
921                    }
922    
923                    Locale[] locales = LanguageUtil.getAvailableLocales();
924    
925                    for (Locale locale : locales) {
926                            String description = descriptionMap.get(locale);
927    
928                            setDescription(description, locale, defaultLocale);
929                    }
930            }
931    
932            @JSON
933            public String getContent() {
934                    if (_content == null) {
935                            return StringPool.BLANK;
936                    }
937                    else {
938                            return _content;
939                    }
940            }
941    
942            public void setContent(String content) {
943                    _content = content;
944            }
945    
946            @JSON
947            public String getType() {
948                    if (_type == null) {
949                            return StringPool.BLANK;
950                    }
951                    else {
952                            return _type;
953                    }
954            }
955    
956            public void setType(String type) {
957                    _type = type;
958            }
959    
960            @JSON
961            public String getStructureId() {
962                    if (_structureId == null) {
963                            return StringPool.BLANK;
964                    }
965                    else {
966                            return _structureId;
967                    }
968            }
969    
970            public void setStructureId(String structureId) {
971                    _columnBitmask |= STRUCTUREID_COLUMN_BITMASK;
972    
973                    if (_originalStructureId == null) {
974                            _originalStructureId = _structureId;
975                    }
976    
977                    _structureId = structureId;
978            }
979    
980            public String getOriginalStructureId() {
981                    return GetterUtil.getString(_originalStructureId);
982            }
983    
984            @JSON
985            public String getTemplateId() {
986                    if (_templateId == null) {
987                            return StringPool.BLANK;
988                    }
989                    else {
990                            return _templateId;
991                    }
992            }
993    
994            public void setTemplateId(String templateId) {
995                    _columnBitmask |= TEMPLATEID_COLUMN_BITMASK;
996    
997                    if (_originalTemplateId == null) {
998                            _originalTemplateId = _templateId;
999                    }
1000    
1001                    _templateId = templateId;
1002            }
1003    
1004            public String getOriginalTemplateId() {
1005                    return GetterUtil.getString(_originalTemplateId);
1006            }
1007    
1008            @JSON
1009            public String getLayoutUuid() {
1010                    if (_layoutUuid == null) {
1011                            return StringPool.BLANK;
1012                    }
1013                    else {
1014                            return _layoutUuid;
1015                    }
1016            }
1017    
1018            public void setLayoutUuid(String layoutUuid) {
1019                    _columnBitmask |= LAYOUTUUID_COLUMN_BITMASK;
1020    
1021                    if (_originalLayoutUuid == null) {
1022                            _originalLayoutUuid = _layoutUuid;
1023                    }
1024    
1025                    _layoutUuid = layoutUuid;
1026            }
1027    
1028            public String getOriginalLayoutUuid() {
1029                    return GetterUtil.getString(_originalLayoutUuid);
1030            }
1031    
1032            @JSON
1033            public Date getDisplayDate() {
1034                    return _displayDate;
1035            }
1036    
1037            public void setDisplayDate(Date displayDate) {
1038                    _displayDate = displayDate;
1039            }
1040    
1041            @JSON
1042            public Date getExpirationDate() {
1043                    return _expirationDate;
1044            }
1045    
1046            public void setExpirationDate(Date expirationDate) {
1047                    _expirationDate = expirationDate;
1048            }
1049    
1050            @JSON
1051            public Date getReviewDate() {
1052                    return _reviewDate;
1053            }
1054    
1055            public void setReviewDate(Date reviewDate) {
1056                    _reviewDate = reviewDate;
1057            }
1058    
1059            @JSON
1060            public boolean getIndexable() {
1061                    return _indexable;
1062            }
1063    
1064            public boolean isIndexable() {
1065                    return _indexable;
1066            }
1067    
1068            public void setIndexable(boolean indexable) {
1069                    _indexable = indexable;
1070            }
1071    
1072            @JSON
1073            public boolean getSmallImage() {
1074                    return _smallImage;
1075            }
1076    
1077            public boolean isSmallImage() {
1078                    return _smallImage;
1079            }
1080    
1081            public void setSmallImage(boolean smallImage) {
1082                    _smallImage = smallImage;
1083            }
1084    
1085            @JSON
1086            public long getSmallImageId() {
1087                    return _smallImageId;
1088            }
1089    
1090            public void setSmallImageId(long smallImageId) {
1091                    _columnBitmask |= SMALLIMAGEID_COLUMN_BITMASK;
1092    
1093                    if (!_setOriginalSmallImageId) {
1094                            _setOriginalSmallImageId = true;
1095    
1096                            _originalSmallImageId = _smallImageId;
1097                    }
1098    
1099                    _smallImageId = smallImageId;
1100            }
1101    
1102            public long getOriginalSmallImageId() {
1103                    return _originalSmallImageId;
1104            }
1105    
1106            @JSON
1107            public String getSmallImageURL() {
1108                    if (_smallImageURL == null) {
1109                            return StringPool.BLANK;
1110                    }
1111                    else {
1112                            return _smallImageURL;
1113                    }
1114            }
1115    
1116            public void setSmallImageURL(String smallImageURL) {
1117                    _smallImageURL = smallImageURL;
1118            }
1119    
1120            @JSON
1121            public int getStatus() {
1122                    return _status;
1123            }
1124    
1125            public void setStatus(int status) {
1126                    _columnBitmask |= STATUS_COLUMN_BITMASK;
1127    
1128                    if (!_setOriginalStatus) {
1129                            _setOriginalStatus = true;
1130    
1131                            _originalStatus = _status;
1132                    }
1133    
1134                    _status = status;
1135            }
1136    
1137            public int getOriginalStatus() {
1138                    return _originalStatus;
1139            }
1140    
1141            @JSON
1142            public long getStatusByUserId() {
1143                    return _statusByUserId;
1144            }
1145    
1146            public void setStatusByUserId(long statusByUserId) {
1147                    _statusByUserId = statusByUserId;
1148            }
1149    
1150            public String getStatusByUserUuid() throws SystemException {
1151                    return PortalUtil.getUserValue(getStatusByUserId(), "uuid",
1152                            _statusByUserUuid);
1153            }
1154    
1155            public void setStatusByUserUuid(String statusByUserUuid) {
1156                    _statusByUserUuid = statusByUserUuid;
1157            }
1158    
1159            @JSON
1160            public String getStatusByUserName() {
1161                    if (_statusByUserName == null) {
1162                            return StringPool.BLANK;
1163                    }
1164                    else {
1165                            return _statusByUserName;
1166                    }
1167            }
1168    
1169            public void setStatusByUserName(String statusByUserName) {
1170                    _statusByUserName = statusByUserName;
1171            }
1172    
1173            @JSON
1174            public Date getStatusDate() {
1175                    return _statusDate;
1176            }
1177    
1178            public void setStatusDate(Date statusDate) {
1179                    _statusDate = statusDate;
1180            }
1181    
1182            /**
1183             * @deprecated {@link #isApproved}
1184             */
1185            public boolean getApproved() {
1186                    return isApproved();
1187            }
1188    
1189            public boolean isApproved() {
1190                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
1191                            return true;
1192                    }
1193                    else {
1194                            return false;
1195                    }
1196            }
1197    
1198            public boolean isDenied() {
1199                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
1200                            return true;
1201                    }
1202                    else {
1203                            return false;
1204                    }
1205            }
1206    
1207            public boolean isDraft() {
1208                    if ((getStatus() == WorkflowConstants.STATUS_DRAFT) ||
1209                                    (getStatus() == WorkflowConstants.STATUS_DRAFT_FROM_APPROVED)) {
1210                            return true;
1211                    }
1212                    else {
1213                            return false;
1214                    }
1215            }
1216    
1217            public boolean isExpired() {
1218                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
1219                            return true;
1220                    }
1221                    else {
1222                            return false;
1223                    }
1224            }
1225    
1226            public boolean isInactive() {
1227                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
1228                            return true;
1229                    }
1230                    else {
1231                            return false;
1232                    }
1233            }
1234    
1235            public boolean isIncomplete() {
1236                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
1237                            return true;
1238                    }
1239                    else {
1240                            return false;
1241                    }
1242            }
1243    
1244            public boolean isPending() {
1245                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
1246                            return true;
1247                    }
1248                    else {
1249                            return false;
1250                    }
1251            }
1252    
1253            public boolean isScheduled() {
1254                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
1255                            return true;
1256                    }
1257                    else {
1258                            return false;
1259                    }
1260            }
1261    
1262            public long getColumnBitmask() {
1263                    return _columnBitmask;
1264            }
1265    
1266            @Override
1267            public ExpandoBridge getExpandoBridge() {
1268                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
1269                            JournalArticle.class.getName(), getPrimaryKey());
1270            }
1271    
1272            @Override
1273            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
1274                    ExpandoBridge expandoBridge = getExpandoBridge();
1275    
1276                    expandoBridge.setAttributes(serviceContext);
1277            }
1278    
1279            @SuppressWarnings("unused")
1280            public void prepareLocalizedFieldsForImport(Locale defaultImportLocale)
1281                    throws LocaleException {
1282                    setTitle(getTitle(defaultImportLocale), defaultImportLocale,
1283                            defaultImportLocale);
1284                    setDescription(getDescription(defaultImportLocale),
1285                            defaultImportLocale, defaultImportLocale);
1286            }
1287    
1288            @Override
1289            public JournalArticle toEscapedModel() {
1290                    if (_escapedModel == null) {
1291                            _escapedModel = (JournalArticle)ProxyUtil.newProxyInstance(_classLoader,
1292                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
1293                    }
1294    
1295                    return _escapedModel;
1296            }
1297    
1298            public JournalArticle toUnescapedModel() {
1299                    return (JournalArticle)this;
1300            }
1301    
1302            @Override
1303            public Object clone() {
1304                    JournalArticleImpl journalArticleImpl = new JournalArticleImpl();
1305    
1306                    journalArticleImpl.setUuid(getUuid());
1307                    journalArticleImpl.setId(getId());
1308                    journalArticleImpl.setResourcePrimKey(getResourcePrimKey());
1309                    journalArticleImpl.setGroupId(getGroupId());
1310                    journalArticleImpl.setCompanyId(getCompanyId());
1311                    journalArticleImpl.setUserId(getUserId());
1312                    journalArticleImpl.setUserName(getUserName());
1313                    journalArticleImpl.setCreateDate(getCreateDate());
1314                    journalArticleImpl.setModifiedDate(getModifiedDate());
1315                    journalArticleImpl.setClassNameId(getClassNameId());
1316                    journalArticleImpl.setClassPK(getClassPK());
1317                    journalArticleImpl.setArticleId(getArticleId());
1318                    journalArticleImpl.setVersion(getVersion());
1319                    journalArticleImpl.setTitle(getTitle());
1320                    journalArticleImpl.setUrlTitle(getUrlTitle());
1321                    journalArticleImpl.setDescription(getDescription());
1322                    journalArticleImpl.setContent(getContent());
1323                    journalArticleImpl.setType(getType());
1324                    journalArticleImpl.setStructureId(getStructureId());
1325                    journalArticleImpl.setTemplateId(getTemplateId());
1326                    journalArticleImpl.setLayoutUuid(getLayoutUuid());
1327                    journalArticleImpl.setDisplayDate(getDisplayDate());
1328                    journalArticleImpl.setExpirationDate(getExpirationDate());
1329                    journalArticleImpl.setReviewDate(getReviewDate());
1330                    journalArticleImpl.setIndexable(getIndexable());
1331                    journalArticleImpl.setSmallImage(getSmallImage());
1332                    journalArticleImpl.setSmallImageId(getSmallImageId());
1333                    journalArticleImpl.setSmallImageURL(getSmallImageURL());
1334                    journalArticleImpl.setStatus(getStatus());
1335                    journalArticleImpl.setStatusByUserId(getStatusByUserId());
1336                    journalArticleImpl.setStatusByUserName(getStatusByUserName());
1337                    journalArticleImpl.setStatusDate(getStatusDate());
1338    
1339                    journalArticleImpl.resetOriginalValues();
1340    
1341                    return journalArticleImpl;
1342            }
1343    
1344            public int compareTo(JournalArticle journalArticle) {
1345                    int value = 0;
1346    
1347                    value = getArticleId().compareTo(journalArticle.getArticleId());
1348    
1349                    if (value != 0) {
1350                            return value;
1351                    }
1352    
1353                    if (getVersion() < journalArticle.getVersion()) {
1354                            value = -1;
1355                    }
1356                    else if (getVersion() > journalArticle.getVersion()) {
1357                            value = 1;
1358                    }
1359                    else {
1360                            value = 0;
1361                    }
1362    
1363                    value = value * -1;
1364    
1365                    if (value != 0) {
1366                            return value;
1367                    }
1368    
1369                    return 0;
1370            }
1371    
1372            @Override
1373            public boolean equals(Object obj) {
1374                    if (this == obj) {
1375                            return true;
1376                    }
1377    
1378                    if (!(obj instanceof JournalArticle)) {
1379                            return false;
1380                    }
1381    
1382                    JournalArticle journalArticle = (JournalArticle)obj;
1383    
1384                    long primaryKey = journalArticle.getPrimaryKey();
1385    
1386                    if (getPrimaryKey() == primaryKey) {
1387                            return true;
1388                    }
1389                    else {
1390                            return false;
1391                    }
1392            }
1393    
1394            @Override
1395            public int hashCode() {
1396                    return (int)getPrimaryKey();
1397            }
1398    
1399            @Override
1400            public void resetOriginalValues() {
1401                    JournalArticleModelImpl journalArticleModelImpl = this;
1402    
1403                    journalArticleModelImpl._originalUuid = journalArticleModelImpl._uuid;
1404    
1405                    journalArticleModelImpl._originalResourcePrimKey = journalArticleModelImpl._resourcePrimKey;
1406    
1407                    journalArticleModelImpl._setOriginalResourcePrimKey = false;
1408    
1409                    journalArticleModelImpl._originalGroupId = journalArticleModelImpl._groupId;
1410    
1411                    journalArticleModelImpl._setOriginalGroupId = false;
1412    
1413                    journalArticleModelImpl._originalCompanyId = journalArticleModelImpl._companyId;
1414    
1415                    journalArticleModelImpl._setOriginalCompanyId = false;
1416    
1417                    journalArticleModelImpl._originalClassNameId = journalArticleModelImpl._classNameId;
1418    
1419                    journalArticleModelImpl._setOriginalClassNameId = false;
1420    
1421                    journalArticleModelImpl._originalClassPK = journalArticleModelImpl._classPK;
1422    
1423                    journalArticleModelImpl._setOriginalClassPK = false;
1424    
1425                    journalArticleModelImpl._originalArticleId = journalArticleModelImpl._articleId;
1426    
1427                    journalArticleModelImpl._originalVersion = journalArticleModelImpl._version;
1428    
1429                    journalArticleModelImpl._setOriginalVersion = false;
1430    
1431                    journalArticleModelImpl._originalUrlTitle = journalArticleModelImpl._urlTitle;
1432    
1433                    journalArticleModelImpl._originalStructureId = journalArticleModelImpl._structureId;
1434    
1435                    journalArticleModelImpl._originalTemplateId = journalArticleModelImpl._templateId;
1436    
1437                    journalArticleModelImpl._originalLayoutUuid = journalArticleModelImpl._layoutUuid;
1438    
1439                    journalArticleModelImpl._originalSmallImageId = journalArticleModelImpl._smallImageId;
1440    
1441                    journalArticleModelImpl._setOriginalSmallImageId = false;
1442    
1443                    journalArticleModelImpl._originalStatus = journalArticleModelImpl._status;
1444    
1445                    journalArticleModelImpl._setOriginalStatus = false;
1446    
1447                    journalArticleModelImpl._columnBitmask = 0;
1448            }
1449    
1450            @Override
1451            public CacheModel<JournalArticle> toCacheModel() {
1452                    JournalArticleCacheModel journalArticleCacheModel = new JournalArticleCacheModel();
1453    
1454                    journalArticleCacheModel.uuid = getUuid();
1455    
1456                    String uuid = journalArticleCacheModel.uuid;
1457    
1458                    if ((uuid != null) && (uuid.length() == 0)) {
1459                            journalArticleCacheModel.uuid = null;
1460                    }
1461    
1462                    journalArticleCacheModel.id = getId();
1463    
1464                    journalArticleCacheModel.resourcePrimKey = getResourcePrimKey();
1465    
1466                    journalArticleCacheModel.groupId = getGroupId();
1467    
1468                    journalArticleCacheModel.companyId = getCompanyId();
1469    
1470                    journalArticleCacheModel.userId = getUserId();
1471    
1472                    journalArticleCacheModel.userName = getUserName();
1473    
1474                    String userName = journalArticleCacheModel.userName;
1475    
1476                    if ((userName != null) && (userName.length() == 0)) {
1477                            journalArticleCacheModel.userName = null;
1478                    }
1479    
1480                    Date createDate = getCreateDate();
1481    
1482                    if (createDate != null) {
1483                            journalArticleCacheModel.createDate = createDate.getTime();
1484                    }
1485                    else {
1486                            journalArticleCacheModel.createDate = Long.MIN_VALUE;
1487                    }
1488    
1489                    Date modifiedDate = getModifiedDate();
1490    
1491                    if (modifiedDate != null) {
1492                            journalArticleCacheModel.modifiedDate = modifiedDate.getTime();
1493                    }
1494                    else {
1495                            journalArticleCacheModel.modifiedDate = Long.MIN_VALUE;
1496                    }
1497    
1498                    journalArticleCacheModel.classNameId = getClassNameId();
1499    
1500                    journalArticleCacheModel.classPK = getClassPK();
1501    
1502                    journalArticleCacheModel.articleId = getArticleId();
1503    
1504                    String articleId = journalArticleCacheModel.articleId;
1505    
1506                    if ((articleId != null) && (articleId.length() == 0)) {
1507                            journalArticleCacheModel.articleId = null;
1508                    }
1509    
1510                    journalArticleCacheModel.version = getVersion();
1511    
1512                    journalArticleCacheModel.title = getTitle();
1513    
1514                    String title = journalArticleCacheModel.title;
1515    
1516                    if ((title != null) && (title.length() == 0)) {
1517                            journalArticleCacheModel.title = null;
1518                    }
1519    
1520                    journalArticleCacheModel.urlTitle = getUrlTitle();
1521    
1522                    String urlTitle = journalArticleCacheModel.urlTitle;
1523    
1524                    if ((urlTitle != null) && (urlTitle.length() == 0)) {
1525                            journalArticleCacheModel.urlTitle = null;
1526                    }
1527    
1528                    journalArticleCacheModel.description = getDescription();
1529    
1530                    String description = journalArticleCacheModel.description;
1531    
1532                    if ((description != null) && (description.length() == 0)) {
1533                            journalArticleCacheModel.description = null;
1534                    }
1535    
1536                    journalArticleCacheModel.content = getContent();
1537    
1538                    String content = journalArticleCacheModel.content;
1539    
1540                    if ((content != null) && (content.length() == 0)) {
1541                            journalArticleCacheModel.content = null;
1542                    }
1543    
1544                    journalArticleCacheModel.type = getType();
1545    
1546                    String type = journalArticleCacheModel.type;
1547    
1548                    if ((type != null) && (type.length() == 0)) {
1549                            journalArticleCacheModel.type = null;
1550                    }
1551    
1552                    journalArticleCacheModel.structureId = getStructureId();
1553    
1554                    String structureId = journalArticleCacheModel.structureId;
1555    
1556                    if ((structureId != null) && (structureId.length() == 0)) {
1557                            journalArticleCacheModel.structureId = null;
1558                    }
1559    
1560                    journalArticleCacheModel.templateId = getTemplateId();
1561    
1562                    String templateId = journalArticleCacheModel.templateId;
1563    
1564                    if ((templateId != null) && (templateId.length() == 0)) {
1565                            journalArticleCacheModel.templateId = null;
1566                    }
1567    
1568                    journalArticleCacheModel.layoutUuid = getLayoutUuid();
1569    
1570                    String layoutUuid = journalArticleCacheModel.layoutUuid;
1571    
1572                    if ((layoutUuid != null) && (layoutUuid.length() == 0)) {
1573                            journalArticleCacheModel.layoutUuid = null;
1574                    }
1575    
1576                    Date displayDate = getDisplayDate();
1577    
1578                    if (displayDate != null) {
1579                            journalArticleCacheModel.displayDate = displayDate.getTime();
1580                    }
1581                    else {
1582                            journalArticleCacheModel.displayDate = Long.MIN_VALUE;
1583                    }
1584    
1585                    Date expirationDate = getExpirationDate();
1586    
1587                    if (expirationDate != null) {
1588                            journalArticleCacheModel.expirationDate = expirationDate.getTime();
1589                    }
1590                    else {
1591                            journalArticleCacheModel.expirationDate = Long.MIN_VALUE;
1592                    }
1593    
1594                    Date reviewDate = getReviewDate();
1595    
1596                    if (reviewDate != null) {
1597                            journalArticleCacheModel.reviewDate = reviewDate.getTime();
1598                    }
1599                    else {
1600                            journalArticleCacheModel.reviewDate = Long.MIN_VALUE;
1601                    }
1602    
1603                    journalArticleCacheModel.indexable = getIndexable();
1604    
1605                    journalArticleCacheModel.smallImage = getSmallImage();
1606    
1607                    journalArticleCacheModel.smallImageId = getSmallImageId();
1608    
1609                    journalArticleCacheModel.smallImageURL = getSmallImageURL();
1610    
1611                    String smallImageURL = journalArticleCacheModel.smallImageURL;
1612    
1613                    if ((smallImageURL != null) && (smallImageURL.length() == 0)) {
1614                            journalArticleCacheModel.smallImageURL = null;
1615                    }
1616    
1617                    journalArticleCacheModel.status = getStatus();
1618    
1619                    journalArticleCacheModel.statusByUserId = getStatusByUserId();
1620    
1621                    journalArticleCacheModel.statusByUserName = getStatusByUserName();
1622    
1623                    String statusByUserName = journalArticleCacheModel.statusByUserName;
1624    
1625                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
1626                            journalArticleCacheModel.statusByUserName = null;
1627                    }
1628    
1629                    Date statusDate = getStatusDate();
1630    
1631                    if (statusDate != null) {
1632                            journalArticleCacheModel.statusDate = statusDate.getTime();
1633                    }
1634                    else {
1635                            journalArticleCacheModel.statusDate = Long.MIN_VALUE;
1636                    }
1637    
1638                    return journalArticleCacheModel;
1639            }
1640    
1641            @Override
1642            public String toString() {
1643                    StringBundler sb = new StringBundler(65);
1644    
1645                    sb.append("{uuid=");
1646                    sb.append(getUuid());
1647                    sb.append(", id=");
1648                    sb.append(getId());
1649                    sb.append(", resourcePrimKey=");
1650                    sb.append(getResourcePrimKey());
1651                    sb.append(", groupId=");
1652                    sb.append(getGroupId());
1653                    sb.append(", companyId=");
1654                    sb.append(getCompanyId());
1655                    sb.append(", userId=");
1656                    sb.append(getUserId());
1657                    sb.append(", userName=");
1658                    sb.append(getUserName());
1659                    sb.append(", createDate=");
1660                    sb.append(getCreateDate());
1661                    sb.append(", modifiedDate=");
1662                    sb.append(getModifiedDate());
1663                    sb.append(", classNameId=");
1664                    sb.append(getClassNameId());
1665                    sb.append(", classPK=");
1666                    sb.append(getClassPK());
1667                    sb.append(", articleId=");
1668                    sb.append(getArticleId());
1669                    sb.append(", version=");
1670                    sb.append(getVersion());
1671                    sb.append(", title=");
1672                    sb.append(getTitle());
1673                    sb.append(", urlTitle=");
1674                    sb.append(getUrlTitle());
1675                    sb.append(", description=");
1676                    sb.append(getDescription());
1677                    sb.append(", content=");
1678                    sb.append(getContent());
1679                    sb.append(", type=");
1680                    sb.append(getType());
1681                    sb.append(", structureId=");
1682                    sb.append(getStructureId());
1683                    sb.append(", templateId=");
1684                    sb.append(getTemplateId());
1685                    sb.append(", layoutUuid=");
1686                    sb.append(getLayoutUuid());
1687                    sb.append(", displayDate=");
1688                    sb.append(getDisplayDate());
1689                    sb.append(", expirationDate=");
1690                    sb.append(getExpirationDate());
1691                    sb.append(", reviewDate=");
1692                    sb.append(getReviewDate());
1693                    sb.append(", indexable=");
1694                    sb.append(getIndexable());
1695                    sb.append(", smallImage=");
1696                    sb.append(getSmallImage());
1697                    sb.append(", smallImageId=");
1698                    sb.append(getSmallImageId());
1699                    sb.append(", smallImageURL=");
1700                    sb.append(getSmallImageURL());
1701                    sb.append(", status=");
1702                    sb.append(getStatus());
1703                    sb.append(", statusByUserId=");
1704                    sb.append(getStatusByUserId());
1705                    sb.append(", statusByUserName=");
1706                    sb.append(getStatusByUserName());
1707                    sb.append(", statusDate=");
1708                    sb.append(getStatusDate());
1709                    sb.append("}");
1710    
1711                    return sb.toString();
1712            }
1713    
1714            public String toXmlString() {
1715                    StringBundler sb = new StringBundler(100);
1716    
1717                    sb.append("<model><model-name>");
1718                    sb.append("com.liferay.portlet.journal.model.JournalArticle");
1719                    sb.append("</model-name>");
1720    
1721                    sb.append(
1722                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1723                    sb.append(getUuid());
1724                    sb.append("]]></column-value></column>");
1725                    sb.append(
1726                            "<column><column-name>id</column-name><column-value><![CDATA[");
1727                    sb.append(getId());
1728                    sb.append("]]></column-value></column>");
1729                    sb.append(
1730                            "<column><column-name>resourcePrimKey</column-name><column-value><![CDATA[");
1731                    sb.append(getResourcePrimKey());
1732                    sb.append("]]></column-value></column>");
1733                    sb.append(
1734                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1735                    sb.append(getGroupId());
1736                    sb.append("]]></column-value></column>");
1737                    sb.append(
1738                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1739                    sb.append(getCompanyId());
1740                    sb.append("]]></column-value></column>");
1741                    sb.append(
1742                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1743                    sb.append(getUserId());
1744                    sb.append("]]></column-value></column>");
1745                    sb.append(
1746                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1747                    sb.append(getUserName());
1748                    sb.append("]]></column-value></column>");
1749                    sb.append(
1750                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1751                    sb.append(getCreateDate());
1752                    sb.append("]]></column-value></column>");
1753                    sb.append(
1754                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1755                    sb.append(getModifiedDate());
1756                    sb.append("]]></column-value></column>");
1757                    sb.append(
1758                            "<column><column-name>classNameId</column-name><column-value><![CDATA[");
1759                    sb.append(getClassNameId());
1760                    sb.append("]]></column-value></column>");
1761                    sb.append(
1762                            "<column><column-name>classPK</column-name><column-value><![CDATA[");
1763                    sb.append(getClassPK());
1764                    sb.append("]]></column-value></column>");
1765                    sb.append(
1766                            "<column><column-name>articleId</column-name><column-value><![CDATA[");
1767                    sb.append(getArticleId());
1768                    sb.append("]]></column-value></column>");
1769                    sb.append(
1770                            "<column><column-name>version</column-name><column-value><![CDATA[");
1771                    sb.append(getVersion());
1772                    sb.append("]]></column-value></column>");
1773                    sb.append(
1774                            "<column><column-name>title</column-name><column-value><![CDATA[");
1775                    sb.append(getTitle());
1776                    sb.append("]]></column-value></column>");
1777                    sb.append(
1778                            "<column><column-name>urlTitle</column-name><column-value><![CDATA[");
1779                    sb.append(getUrlTitle());
1780                    sb.append("]]></column-value></column>");
1781                    sb.append(
1782                            "<column><column-name>description</column-name><column-value><![CDATA[");
1783                    sb.append(getDescription());
1784                    sb.append("]]></column-value></column>");
1785                    sb.append(
1786                            "<column><column-name>content</column-name><column-value><![CDATA[");
1787                    sb.append(getContent());
1788                    sb.append("]]></column-value></column>");
1789                    sb.append(
1790                            "<column><column-name>type</column-name><column-value><![CDATA[");
1791                    sb.append(getType());
1792                    sb.append("]]></column-value></column>");
1793                    sb.append(
1794                            "<column><column-name>structureId</column-name><column-value><![CDATA[");
1795                    sb.append(getStructureId());
1796                    sb.append("]]></column-value></column>");
1797                    sb.append(
1798                            "<column><column-name>templateId</column-name><column-value><![CDATA[");
1799                    sb.append(getTemplateId());
1800                    sb.append("]]></column-value></column>");
1801                    sb.append(
1802                            "<column><column-name>layoutUuid</column-name><column-value><![CDATA[");
1803                    sb.append(getLayoutUuid());
1804                    sb.append("]]></column-value></column>");
1805                    sb.append(
1806                            "<column><column-name>displayDate</column-name><column-value><![CDATA[");
1807                    sb.append(getDisplayDate());
1808                    sb.append("]]></column-value></column>");
1809                    sb.append(
1810                            "<column><column-name>expirationDate</column-name><column-value><![CDATA[");
1811                    sb.append(getExpirationDate());
1812                    sb.append("]]></column-value></column>");
1813                    sb.append(
1814                            "<column><column-name>reviewDate</column-name><column-value><![CDATA[");
1815                    sb.append(getReviewDate());
1816                    sb.append("]]></column-value></column>");
1817                    sb.append(
1818                            "<column><column-name>indexable</column-name><column-value><![CDATA[");
1819                    sb.append(getIndexable());
1820                    sb.append("]]></column-value></column>");
1821                    sb.append(
1822                            "<column><column-name>smallImage</column-name><column-value><![CDATA[");
1823                    sb.append(getSmallImage());
1824                    sb.append("]]></column-value></column>");
1825                    sb.append(
1826                            "<column><column-name>smallImageId</column-name><column-value><![CDATA[");
1827                    sb.append(getSmallImageId());
1828                    sb.append("]]></column-value></column>");
1829                    sb.append(
1830                            "<column><column-name>smallImageURL</column-name><column-value><![CDATA[");
1831                    sb.append(getSmallImageURL());
1832                    sb.append("]]></column-value></column>");
1833                    sb.append(
1834                            "<column><column-name>status</column-name><column-value><![CDATA[");
1835                    sb.append(getStatus());
1836                    sb.append("]]></column-value></column>");
1837                    sb.append(
1838                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1839                    sb.append(getStatusByUserId());
1840                    sb.append("]]></column-value></column>");
1841                    sb.append(
1842                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1843                    sb.append(getStatusByUserName());
1844                    sb.append("]]></column-value></column>");
1845                    sb.append(
1846                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1847                    sb.append(getStatusDate());
1848                    sb.append("]]></column-value></column>");
1849    
1850                    sb.append("</model>");
1851    
1852                    return sb.toString();
1853            }
1854    
1855            private static ClassLoader _classLoader = JournalArticle.class.getClassLoader();
1856            private static Class<?>[] _escapedModelInterfaces = new Class[] {
1857                            JournalArticle.class
1858                    };
1859            private String _uuid;
1860            private String _originalUuid;
1861            private long _id;
1862            private long _resourcePrimKey;
1863            private long _originalResourcePrimKey;
1864            private boolean _setOriginalResourcePrimKey;
1865            private long _groupId;
1866            private long _originalGroupId;
1867            private boolean _setOriginalGroupId;
1868            private long _companyId;
1869            private long _originalCompanyId;
1870            private boolean _setOriginalCompanyId;
1871            private long _userId;
1872            private String _userUuid;
1873            private String _userName;
1874            private Date _createDate;
1875            private Date _modifiedDate;
1876            private long _classNameId;
1877            private long _originalClassNameId;
1878            private boolean _setOriginalClassNameId;
1879            private long _classPK;
1880            private long _originalClassPK;
1881            private boolean _setOriginalClassPK;
1882            private String _articleId;
1883            private String _originalArticleId;
1884            private double _version;
1885            private double _originalVersion;
1886            private boolean _setOriginalVersion;
1887            private String _title;
1888            private String _titleCurrentLanguageId;
1889            private String _urlTitle;
1890            private String _originalUrlTitle;
1891            private String _description;
1892            private String _descriptionCurrentLanguageId;
1893            private String _content;
1894            private String _type;
1895            private String _structureId;
1896            private String _originalStructureId;
1897            private String _templateId;
1898            private String _originalTemplateId;
1899            private String _layoutUuid;
1900            private String _originalLayoutUuid;
1901            private Date _displayDate;
1902            private Date _expirationDate;
1903            private Date _reviewDate;
1904            private boolean _indexable;
1905            private boolean _smallImage;
1906            private long _smallImageId;
1907            private long _originalSmallImageId;
1908            private boolean _setOriginalSmallImageId;
1909            private String _smallImageURL;
1910            private int _status;
1911            private int _originalStatus;
1912            private boolean _setOriginalStatus;
1913            private long _statusByUserId;
1914            private String _statusByUserUuid;
1915            private String _statusByUserName;
1916            private Date _statusDate;
1917            private long _columnBitmask;
1918            private JournalArticle _escapedModel;
1919    }