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.documentlibrary.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.documentlibrary.model.DLFolder;
031    import com.liferay.portlet.documentlibrary.model.DLFolderModel;
032    import com.liferay.portlet.documentlibrary.model.DLFolderSoap;
033    import com.liferay.portlet.expando.model.ExpandoBridge;
034    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
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 DLFolder service. Represents a row in the "DLFolder" 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.documentlibrary.model.DLFolderModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link DLFolderImpl}.
051     * </p>
052     *
053     * @author Brian Wing Shun Chan
054     * @see DLFolderImpl
055     * @see com.liferay.portlet.documentlibrary.model.DLFolder
056     * @see com.liferay.portlet.documentlibrary.model.DLFolderModel
057     * @generated
058     */
059    @JSON(strict = true)
060    public class DLFolderModelImpl extends BaseModelImpl<DLFolder>
061            implements DLFolderModel {
062            /*
063             * NOTE FOR DEVELOPERS:
064             *
065             * Never modify or reference this class directly. All methods that expect a document library folder model instance should use the {@link com.liferay.portlet.documentlibrary.model.DLFolder} interface instead.
066             */
067            public static final String TABLE_NAME = "DLFolder";
068            public static final Object[][] TABLE_COLUMNS = {
069                            { "uuid_", Types.VARCHAR },
070                            { "folderId", Types.BIGINT },
071                            { "groupId", Types.BIGINT },
072                            { "companyId", Types.BIGINT },
073                            { "userId", Types.BIGINT },
074                            { "userName", Types.VARCHAR },
075                            { "createDate", Types.TIMESTAMP },
076                            { "modifiedDate", Types.TIMESTAMP },
077                            { "repositoryId", Types.BIGINT },
078                            { "mountPoint", Types.BOOLEAN },
079                            { "parentFolderId", Types.BIGINT },
080                            { "name", Types.VARCHAR },
081                            { "description", Types.VARCHAR },
082                            { "lastPostDate", Types.TIMESTAMP },
083                            { "defaultFileEntryTypeId", Types.BIGINT },
084                            { "hidden_", Types.BOOLEAN },
085                            { "overrideFileEntryTypes", Types.BOOLEAN },
086                            { "status", Types.INTEGER },
087                            { "statusByUserId", Types.BIGINT },
088                            { "statusByUserName", Types.VARCHAR },
089                            { "statusDate", Types.TIMESTAMP }
090                    };
091            public static final String TABLE_SQL_CREATE = "create table DLFolder (uuid_ VARCHAR(75) null,folderId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,repositoryId LONG,mountPoint BOOLEAN,parentFolderId LONG,name VARCHAR(100) null,description STRING null,lastPostDate DATE null,defaultFileEntryTypeId LONG,hidden_ BOOLEAN,overrideFileEntryTypes BOOLEAN,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
092            public static final String TABLE_SQL_DROP = "drop table DLFolder";
093            public static final String ORDER_BY_JPQL = " ORDER BY dlFolder.parentFolderId ASC, dlFolder.name ASC";
094            public static final String ORDER_BY_SQL = " ORDER BY DLFolder.parentFolderId ASC, DLFolder.name ASC";
095            public static final String DATA_SOURCE = "liferayDataSource";
096            public static final String SESSION_FACTORY = "liferaySessionFactory";
097            public static final String TX_MANAGER = "liferayTransactionManager";
098            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
099                                    "value.object.entity.cache.enabled.com.liferay.portlet.documentlibrary.model.DLFolder"),
100                            true);
101            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
102                                    "value.object.finder.cache.enabled.com.liferay.portlet.documentlibrary.model.DLFolder"),
103                            true);
104            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
105                                    "value.object.column.bitmask.enabled.com.liferay.portlet.documentlibrary.model.DLFolder"),
106                            true);
107            public static long COMPANYID_COLUMN_BITMASK = 1L;
108            public static long GROUPID_COLUMN_BITMASK = 2L;
109            public static long HIDDEN_COLUMN_BITMASK = 4L;
110            public static long MOUNTPOINT_COLUMN_BITMASK = 8L;
111            public static long NAME_COLUMN_BITMASK = 16L;
112            public static long PARENTFOLDERID_COLUMN_BITMASK = 32L;
113            public static long REPOSITORYID_COLUMN_BITMASK = 64L;
114            public static long STATUS_COLUMN_BITMASK = 128L;
115            public static long UUID_COLUMN_BITMASK = 256L;
116    
117            /**
118             * Converts the soap model instance into a normal model instance.
119             *
120             * @param soapModel the soap model instance to convert
121             * @return the normal model instance
122             */
123            public static DLFolder toModel(DLFolderSoap soapModel) {
124                    if (soapModel == null) {
125                            return null;
126                    }
127    
128                    DLFolder model = new DLFolderImpl();
129    
130                    model.setUuid(soapModel.getUuid());
131                    model.setFolderId(soapModel.getFolderId());
132                    model.setGroupId(soapModel.getGroupId());
133                    model.setCompanyId(soapModel.getCompanyId());
134                    model.setUserId(soapModel.getUserId());
135                    model.setUserName(soapModel.getUserName());
136                    model.setCreateDate(soapModel.getCreateDate());
137                    model.setModifiedDate(soapModel.getModifiedDate());
138                    model.setRepositoryId(soapModel.getRepositoryId());
139                    model.setMountPoint(soapModel.getMountPoint());
140                    model.setParentFolderId(soapModel.getParentFolderId());
141                    model.setName(soapModel.getName());
142                    model.setDescription(soapModel.getDescription());
143                    model.setLastPostDate(soapModel.getLastPostDate());
144                    model.setDefaultFileEntryTypeId(soapModel.getDefaultFileEntryTypeId());
145                    model.setHidden(soapModel.getHidden());
146                    model.setOverrideFileEntryTypes(soapModel.getOverrideFileEntryTypes());
147                    model.setStatus(soapModel.getStatus());
148                    model.setStatusByUserId(soapModel.getStatusByUserId());
149                    model.setStatusByUserName(soapModel.getStatusByUserName());
150                    model.setStatusDate(soapModel.getStatusDate());
151    
152                    return model;
153            }
154    
155            /**
156             * Converts the soap model instances into normal model instances.
157             *
158             * @param soapModels the soap model instances to convert
159             * @return the normal model instances
160             */
161            public static List<DLFolder> toModels(DLFolderSoap[] soapModels) {
162                    if (soapModels == null) {
163                            return null;
164                    }
165    
166                    List<DLFolder> models = new ArrayList<DLFolder>(soapModels.length);
167    
168                    for (DLFolderSoap soapModel : soapModels) {
169                            models.add(toModel(soapModel));
170                    }
171    
172                    return models;
173            }
174    
175            public static final String MAPPING_TABLE_DLFILEENTRYTYPES_DLFOLDERS_NAME = "DLFileEntryTypes_DLFolders";
176            public static final Object[][] MAPPING_TABLE_DLFILEENTRYTYPES_DLFOLDERS_COLUMNS =
177                    {
178                            { "fileEntryTypeId", Types.BIGINT },
179                            { "folderId", Types.BIGINT }
180                    };
181            public static final String MAPPING_TABLE_DLFILEENTRYTYPES_DLFOLDERS_SQL_CREATE =
182                    "create table DLFileEntryTypes_DLFolders (fileEntryTypeId LONG not null,folderId LONG not null,primary key (fileEntryTypeId, folderId))";
183            public static final boolean FINDER_CACHE_ENABLED_DLFILEENTRYTYPES_DLFOLDERS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
184                                    "value.object.finder.cache.enabled.DLFileEntryTypes_DLFolders"),
185                            true);
186            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
187                                    "lock.expiration.time.com.liferay.portlet.documentlibrary.model.DLFolder"));
188    
189            public DLFolderModelImpl() {
190            }
191    
192            public long getPrimaryKey() {
193                    return _folderId;
194            }
195    
196            public void setPrimaryKey(long primaryKey) {
197                    setFolderId(primaryKey);
198            }
199    
200            public Serializable getPrimaryKeyObj() {
201                    return _folderId;
202            }
203    
204            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
205                    setPrimaryKey(((Long)primaryKeyObj).longValue());
206            }
207    
208            public Class<?> getModelClass() {
209                    return DLFolder.class;
210            }
211    
212            public String getModelClassName() {
213                    return DLFolder.class.getName();
214            }
215    
216            @Override
217            public Map<String, Object> getModelAttributes() {
218                    Map<String, Object> attributes = new HashMap<String, Object>();
219    
220                    attributes.put("uuid", getUuid());
221                    attributes.put("folderId", getFolderId());
222                    attributes.put("groupId", getGroupId());
223                    attributes.put("companyId", getCompanyId());
224                    attributes.put("userId", getUserId());
225                    attributes.put("userName", getUserName());
226                    attributes.put("createDate", getCreateDate());
227                    attributes.put("modifiedDate", getModifiedDate());
228                    attributes.put("repositoryId", getRepositoryId());
229                    attributes.put("mountPoint", getMountPoint());
230                    attributes.put("parentFolderId", getParentFolderId());
231                    attributes.put("name", getName());
232                    attributes.put("description", getDescription());
233                    attributes.put("lastPostDate", getLastPostDate());
234                    attributes.put("defaultFileEntryTypeId", getDefaultFileEntryTypeId());
235                    attributes.put("hidden", getHidden());
236                    attributes.put("overrideFileEntryTypes", getOverrideFileEntryTypes());
237                    attributes.put("status", getStatus());
238                    attributes.put("statusByUserId", getStatusByUserId());
239                    attributes.put("statusByUserName", getStatusByUserName());
240                    attributes.put("statusDate", getStatusDate());
241    
242                    return attributes;
243            }
244    
245            @Override
246            public void setModelAttributes(Map<String, Object> attributes) {
247                    String uuid = (String)attributes.get("uuid");
248    
249                    if (uuid != null) {
250                            setUuid(uuid);
251                    }
252    
253                    Long folderId = (Long)attributes.get("folderId");
254    
255                    if (folderId != null) {
256                            setFolderId(folderId);
257                    }
258    
259                    Long groupId = (Long)attributes.get("groupId");
260    
261                    if (groupId != null) {
262                            setGroupId(groupId);
263                    }
264    
265                    Long companyId = (Long)attributes.get("companyId");
266    
267                    if (companyId != null) {
268                            setCompanyId(companyId);
269                    }
270    
271                    Long userId = (Long)attributes.get("userId");
272    
273                    if (userId != null) {
274                            setUserId(userId);
275                    }
276    
277                    String userName = (String)attributes.get("userName");
278    
279                    if (userName != null) {
280                            setUserName(userName);
281                    }
282    
283                    Date createDate = (Date)attributes.get("createDate");
284    
285                    if (createDate != null) {
286                            setCreateDate(createDate);
287                    }
288    
289                    Date modifiedDate = (Date)attributes.get("modifiedDate");
290    
291                    if (modifiedDate != null) {
292                            setModifiedDate(modifiedDate);
293                    }
294    
295                    Long repositoryId = (Long)attributes.get("repositoryId");
296    
297                    if (repositoryId != null) {
298                            setRepositoryId(repositoryId);
299                    }
300    
301                    Boolean mountPoint = (Boolean)attributes.get("mountPoint");
302    
303                    if (mountPoint != null) {
304                            setMountPoint(mountPoint);
305                    }
306    
307                    Long parentFolderId = (Long)attributes.get("parentFolderId");
308    
309                    if (parentFolderId != null) {
310                            setParentFolderId(parentFolderId);
311                    }
312    
313                    String name = (String)attributes.get("name");
314    
315                    if (name != null) {
316                            setName(name);
317                    }
318    
319                    String description = (String)attributes.get("description");
320    
321                    if (description != null) {
322                            setDescription(description);
323                    }
324    
325                    Date lastPostDate = (Date)attributes.get("lastPostDate");
326    
327                    if (lastPostDate != null) {
328                            setLastPostDate(lastPostDate);
329                    }
330    
331                    Long defaultFileEntryTypeId = (Long)attributes.get(
332                                    "defaultFileEntryTypeId");
333    
334                    if (defaultFileEntryTypeId != null) {
335                            setDefaultFileEntryTypeId(defaultFileEntryTypeId);
336                    }
337    
338                    Boolean hidden = (Boolean)attributes.get("hidden");
339    
340                    if (hidden != null) {
341                            setHidden(hidden);
342                    }
343    
344                    Boolean overrideFileEntryTypes = (Boolean)attributes.get(
345                                    "overrideFileEntryTypes");
346    
347                    if (overrideFileEntryTypes != null) {
348                            setOverrideFileEntryTypes(overrideFileEntryTypes);
349                    }
350    
351                    Integer status = (Integer)attributes.get("status");
352    
353                    if (status != null) {
354                            setStatus(status);
355                    }
356    
357                    Long statusByUserId = (Long)attributes.get("statusByUserId");
358    
359                    if (statusByUserId != null) {
360                            setStatusByUserId(statusByUserId);
361                    }
362    
363                    String statusByUserName = (String)attributes.get("statusByUserName");
364    
365                    if (statusByUserName != null) {
366                            setStatusByUserName(statusByUserName);
367                    }
368    
369                    Date statusDate = (Date)attributes.get("statusDate");
370    
371                    if (statusDate != null) {
372                            setStatusDate(statusDate);
373                    }
374            }
375    
376            @JSON
377            public String getUuid() {
378                    if (_uuid == null) {
379                            return StringPool.BLANK;
380                    }
381                    else {
382                            return _uuid;
383                    }
384            }
385    
386            public void setUuid(String uuid) {
387                    if (_originalUuid == null) {
388                            _originalUuid = _uuid;
389                    }
390    
391                    _uuid = uuid;
392            }
393    
394            public String getOriginalUuid() {
395                    return GetterUtil.getString(_originalUuid);
396            }
397    
398            @JSON
399            public long getFolderId() {
400                    return _folderId;
401            }
402    
403            public void setFolderId(long folderId) {
404                    _folderId = folderId;
405            }
406    
407            @JSON
408            public long getGroupId() {
409                    return _groupId;
410            }
411    
412            public void setGroupId(long groupId) {
413                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
414    
415                    if (!_setOriginalGroupId) {
416                            _setOriginalGroupId = true;
417    
418                            _originalGroupId = _groupId;
419                    }
420    
421                    _groupId = groupId;
422            }
423    
424            public long getOriginalGroupId() {
425                    return _originalGroupId;
426            }
427    
428            @JSON
429            public long getCompanyId() {
430                    return _companyId;
431            }
432    
433            public void setCompanyId(long companyId) {
434                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
435    
436                    if (!_setOriginalCompanyId) {
437                            _setOriginalCompanyId = true;
438    
439                            _originalCompanyId = _companyId;
440                    }
441    
442                    _companyId = companyId;
443            }
444    
445            public long getOriginalCompanyId() {
446                    return _originalCompanyId;
447            }
448    
449            @JSON
450            public long getUserId() {
451                    return _userId;
452            }
453    
454            public void setUserId(long userId) {
455                    _userId = userId;
456            }
457    
458            public String getUserUuid() throws SystemException {
459                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
460            }
461    
462            public void setUserUuid(String userUuid) {
463                    _userUuid = userUuid;
464            }
465    
466            @JSON
467            public String getUserName() {
468                    if (_userName == null) {
469                            return StringPool.BLANK;
470                    }
471                    else {
472                            return _userName;
473                    }
474            }
475    
476            public void setUserName(String userName) {
477                    _userName = userName;
478            }
479    
480            @JSON
481            public Date getCreateDate() {
482                    return _createDate;
483            }
484    
485            public void setCreateDate(Date createDate) {
486                    _createDate = createDate;
487            }
488    
489            @JSON
490            public Date getModifiedDate() {
491                    return _modifiedDate;
492            }
493    
494            public void setModifiedDate(Date modifiedDate) {
495                    _modifiedDate = modifiedDate;
496            }
497    
498            @JSON
499            public long getRepositoryId() {
500                    return _repositoryId;
501            }
502    
503            public void setRepositoryId(long repositoryId) {
504                    _columnBitmask |= REPOSITORYID_COLUMN_BITMASK;
505    
506                    if (!_setOriginalRepositoryId) {
507                            _setOriginalRepositoryId = true;
508    
509                            _originalRepositoryId = _repositoryId;
510                    }
511    
512                    _repositoryId = repositoryId;
513            }
514    
515            public long getOriginalRepositoryId() {
516                    return _originalRepositoryId;
517            }
518    
519            @JSON
520            public boolean getMountPoint() {
521                    return _mountPoint;
522            }
523    
524            public boolean isMountPoint() {
525                    return _mountPoint;
526            }
527    
528            public void setMountPoint(boolean mountPoint) {
529                    _columnBitmask |= MOUNTPOINT_COLUMN_BITMASK;
530    
531                    if (!_setOriginalMountPoint) {
532                            _setOriginalMountPoint = true;
533    
534                            _originalMountPoint = _mountPoint;
535                    }
536    
537                    _mountPoint = mountPoint;
538            }
539    
540            public boolean getOriginalMountPoint() {
541                    return _originalMountPoint;
542            }
543    
544            @JSON
545            public long getParentFolderId() {
546                    return _parentFolderId;
547            }
548    
549            public void setParentFolderId(long parentFolderId) {
550                    _columnBitmask = -1L;
551    
552                    if (!_setOriginalParentFolderId) {
553                            _setOriginalParentFolderId = true;
554    
555                            _originalParentFolderId = _parentFolderId;
556                    }
557    
558                    _parentFolderId = parentFolderId;
559            }
560    
561            public long getOriginalParentFolderId() {
562                    return _originalParentFolderId;
563            }
564    
565            @JSON
566            public String getName() {
567                    if (_name == null) {
568                            return StringPool.BLANK;
569                    }
570                    else {
571                            return _name;
572                    }
573            }
574    
575            public void setName(String name) {
576                    _columnBitmask = -1L;
577    
578                    if (_originalName == null) {
579                            _originalName = _name;
580                    }
581    
582                    _name = name;
583            }
584    
585            public String getOriginalName() {
586                    return GetterUtil.getString(_originalName);
587            }
588    
589            @JSON
590            public String getDescription() {
591                    if (_description == null) {
592                            return StringPool.BLANK;
593                    }
594                    else {
595                            return _description;
596                    }
597            }
598    
599            public void setDescription(String description) {
600                    _description = description;
601            }
602    
603            @JSON
604            public Date getLastPostDate() {
605                    return _lastPostDate;
606            }
607    
608            public void setLastPostDate(Date lastPostDate) {
609                    _lastPostDate = lastPostDate;
610            }
611    
612            @JSON
613            public long getDefaultFileEntryTypeId() {
614                    return _defaultFileEntryTypeId;
615            }
616    
617            public void setDefaultFileEntryTypeId(long defaultFileEntryTypeId) {
618                    _defaultFileEntryTypeId = defaultFileEntryTypeId;
619            }
620    
621            @JSON
622            public boolean getHidden() {
623                    return _hidden;
624            }
625    
626            public boolean isHidden() {
627                    return _hidden;
628            }
629    
630            public void setHidden(boolean hidden) {
631                    _columnBitmask |= HIDDEN_COLUMN_BITMASK;
632    
633                    if (!_setOriginalHidden) {
634                            _setOriginalHidden = true;
635    
636                            _originalHidden = _hidden;
637                    }
638    
639                    _hidden = hidden;
640            }
641    
642            public boolean getOriginalHidden() {
643                    return _originalHidden;
644            }
645    
646            @JSON
647            public boolean getOverrideFileEntryTypes() {
648                    return _overrideFileEntryTypes;
649            }
650    
651            public boolean isOverrideFileEntryTypes() {
652                    return _overrideFileEntryTypes;
653            }
654    
655            public void setOverrideFileEntryTypes(boolean overrideFileEntryTypes) {
656                    _overrideFileEntryTypes = overrideFileEntryTypes;
657            }
658    
659            @JSON
660            public int getStatus() {
661                    return _status;
662            }
663    
664            public void setStatus(int status) {
665                    _columnBitmask |= STATUS_COLUMN_BITMASK;
666    
667                    if (!_setOriginalStatus) {
668                            _setOriginalStatus = true;
669    
670                            _originalStatus = _status;
671                    }
672    
673                    _status = status;
674            }
675    
676            public int getOriginalStatus() {
677                    return _originalStatus;
678            }
679    
680            @JSON
681            public long getStatusByUserId() {
682                    return _statusByUserId;
683            }
684    
685            public void setStatusByUserId(long statusByUserId) {
686                    _statusByUserId = statusByUserId;
687            }
688    
689            public String getStatusByUserUuid() throws SystemException {
690                    return PortalUtil.getUserValue(getStatusByUserId(), "uuid",
691                            _statusByUserUuid);
692            }
693    
694            public void setStatusByUserUuid(String statusByUserUuid) {
695                    _statusByUserUuid = statusByUserUuid;
696            }
697    
698            @JSON
699            public String getStatusByUserName() {
700                    if (_statusByUserName == null) {
701                            return StringPool.BLANK;
702                    }
703                    else {
704                            return _statusByUserName;
705                    }
706            }
707    
708            public void setStatusByUserName(String statusByUserName) {
709                    _statusByUserName = statusByUserName;
710            }
711    
712            @JSON
713            public Date getStatusDate() {
714                    return _statusDate;
715            }
716    
717            public void setStatusDate(Date statusDate) {
718                    _statusDate = statusDate;
719            }
720    
721            public long getContainerModelId() {
722                    return getFolderId();
723            }
724    
725            public void setContainerModelId(long containerModelId) {
726                    _folderId = containerModelId;
727            }
728    
729            public long getParentContainerModelId() {
730                    return getParentFolderId();
731            }
732    
733            public void setParentContainerModelId(long parentContainerModelId) {
734                    _parentFolderId = parentContainerModelId;
735            }
736    
737            public String getContainerModelName() {
738                    return String.valueOf(getName());
739            }
740    
741            /**
742             * @deprecated As of 6.1.0, replaced by {@link #isApproved}
743             */
744            public boolean getApproved() {
745                    return isApproved();
746            }
747    
748            public boolean isApproved() {
749                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
750                            return true;
751                    }
752                    else {
753                            return false;
754                    }
755            }
756    
757            public boolean isDenied() {
758                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
759                            return true;
760                    }
761                    else {
762                            return false;
763                    }
764            }
765    
766            public boolean isDraft() {
767                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
768                            return true;
769                    }
770                    else {
771                            return false;
772                    }
773            }
774    
775            public boolean isExpired() {
776                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
777                            return true;
778                    }
779                    else {
780                            return false;
781                    }
782            }
783    
784            public boolean isInactive() {
785                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
786                            return true;
787                    }
788                    else {
789                            return false;
790                    }
791            }
792    
793            public boolean isIncomplete() {
794                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
795                            return true;
796                    }
797                    else {
798                            return false;
799                    }
800            }
801    
802            public boolean isInTrash() {
803                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
804                            return true;
805                    }
806                    else {
807                            return false;
808                    }
809            }
810    
811            public boolean isPending() {
812                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
813                            return true;
814                    }
815                    else {
816                            return false;
817                    }
818            }
819    
820            public boolean isScheduled() {
821                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
822                            return true;
823                    }
824                    else {
825                            return false;
826                    }
827            }
828    
829            public long getColumnBitmask() {
830                    return _columnBitmask;
831            }
832    
833            @Override
834            public ExpandoBridge getExpandoBridge() {
835                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
836                            DLFolder.class.getName(), getPrimaryKey());
837            }
838    
839            @Override
840            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
841                    ExpandoBridge expandoBridge = getExpandoBridge();
842    
843                    expandoBridge.setAttributes(serviceContext);
844            }
845    
846            @Override
847            public DLFolder toEscapedModel() {
848                    if (_escapedModel == null) {
849                            _escapedModel = (DLFolder)ProxyUtil.newProxyInstance(_classLoader,
850                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
851                    }
852    
853                    return _escapedModel;
854            }
855    
856            @Override
857            public Object clone() {
858                    DLFolderImpl dlFolderImpl = new DLFolderImpl();
859    
860                    dlFolderImpl.setUuid(getUuid());
861                    dlFolderImpl.setFolderId(getFolderId());
862                    dlFolderImpl.setGroupId(getGroupId());
863                    dlFolderImpl.setCompanyId(getCompanyId());
864                    dlFolderImpl.setUserId(getUserId());
865                    dlFolderImpl.setUserName(getUserName());
866                    dlFolderImpl.setCreateDate(getCreateDate());
867                    dlFolderImpl.setModifiedDate(getModifiedDate());
868                    dlFolderImpl.setRepositoryId(getRepositoryId());
869                    dlFolderImpl.setMountPoint(getMountPoint());
870                    dlFolderImpl.setParentFolderId(getParentFolderId());
871                    dlFolderImpl.setName(getName());
872                    dlFolderImpl.setDescription(getDescription());
873                    dlFolderImpl.setLastPostDate(getLastPostDate());
874                    dlFolderImpl.setDefaultFileEntryTypeId(getDefaultFileEntryTypeId());
875                    dlFolderImpl.setHidden(getHidden());
876                    dlFolderImpl.setOverrideFileEntryTypes(getOverrideFileEntryTypes());
877                    dlFolderImpl.setStatus(getStatus());
878                    dlFolderImpl.setStatusByUserId(getStatusByUserId());
879                    dlFolderImpl.setStatusByUserName(getStatusByUserName());
880                    dlFolderImpl.setStatusDate(getStatusDate());
881    
882                    dlFolderImpl.resetOriginalValues();
883    
884                    return dlFolderImpl;
885            }
886    
887            public int compareTo(DLFolder dlFolder) {
888                    int value = 0;
889    
890                    if (getParentFolderId() < dlFolder.getParentFolderId()) {
891                            value = -1;
892                    }
893                    else if (getParentFolderId() > dlFolder.getParentFolderId()) {
894                            value = 1;
895                    }
896                    else {
897                            value = 0;
898                    }
899    
900                    if (value != 0) {
901                            return value;
902                    }
903    
904                    value = getName().compareToIgnoreCase(dlFolder.getName());
905    
906                    if (value != 0) {
907                            return value;
908                    }
909    
910                    return 0;
911            }
912    
913            @Override
914            public boolean equals(Object obj) {
915                    if (obj == null) {
916                            return false;
917                    }
918    
919                    DLFolder dlFolder = null;
920    
921                    try {
922                            dlFolder = (DLFolder)obj;
923                    }
924                    catch (ClassCastException cce) {
925                            return false;
926                    }
927    
928                    long primaryKey = dlFolder.getPrimaryKey();
929    
930                    if (getPrimaryKey() == primaryKey) {
931                            return true;
932                    }
933                    else {
934                            return false;
935                    }
936            }
937    
938            @Override
939            public int hashCode() {
940                    return (int)getPrimaryKey();
941            }
942    
943            @Override
944            public void resetOriginalValues() {
945                    DLFolderModelImpl dlFolderModelImpl = this;
946    
947                    dlFolderModelImpl._originalUuid = dlFolderModelImpl._uuid;
948    
949                    dlFolderModelImpl._originalGroupId = dlFolderModelImpl._groupId;
950    
951                    dlFolderModelImpl._setOriginalGroupId = false;
952    
953                    dlFolderModelImpl._originalCompanyId = dlFolderModelImpl._companyId;
954    
955                    dlFolderModelImpl._setOriginalCompanyId = false;
956    
957                    dlFolderModelImpl._originalRepositoryId = dlFolderModelImpl._repositoryId;
958    
959                    dlFolderModelImpl._setOriginalRepositoryId = false;
960    
961                    dlFolderModelImpl._originalMountPoint = dlFolderModelImpl._mountPoint;
962    
963                    dlFolderModelImpl._setOriginalMountPoint = false;
964    
965                    dlFolderModelImpl._originalParentFolderId = dlFolderModelImpl._parentFolderId;
966    
967                    dlFolderModelImpl._setOriginalParentFolderId = false;
968    
969                    dlFolderModelImpl._originalName = dlFolderModelImpl._name;
970    
971                    dlFolderModelImpl._originalHidden = dlFolderModelImpl._hidden;
972    
973                    dlFolderModelImpl._setOriginalHidden = false;
974    
975                    dlFolderModelImpl._originalStatus = dlFolderModelImpl._status;
976    
977                    dlFolderModelImpl._setOriginalStatus = false;
978    
979                    dlFolderModelImpl._columnBitmask = 0;
980            }
981    
982            @Override
983            public CacheModel<DLFolder> toCacheModel() {
984                    DLFolderCacheModel dlFolderCacheModel = new DLFolderCacheModel();
985    
986                    dlFolderCacheModel.uuid = getUuid();
987    
988                    String uuid = dlFolderCacheModel.uuid;
989    
990                    if ((uuid != null) && (uuid.length() == 0)) {
991                            dlFolderCacheModel.uuid = null;
992                    }
993    
994                    dlFolderCacheModel.folderId = getFolderId();
995    
996                    dlFolderCacheModel.groupId = getGroupId();
997    
998                    dlFolderCacheModel.companyId = getCompanyId();
999    
1000                    dlFolderCacheModel.userId = getUserId();
1001    
1002                    dlFolderCacheModel.userName = getUserName();
1003    
1004                    String userName = dlFolderCacheModel.userName;
1005    
1006                    if ((userName != null) && (userName.length() == 0)) {
1007                            dlFolderCacheModel.userName = null;
1008                    }
1009    
1010                    Date createDate = getCreateDate();
1011    
1012                    if (createDate != null) {
1013                            dlFolderCacheModel.createDate = createDate.getTime();
1014                    }
1015                    else {
1016                            dlFolderCacheModel.createDate = Long.MIN_VALUE;
1017                    }
1018    
1019                    Date modifiedDate = getModifiedDate();
1020    
1021                    if (modifiedDate != null) {
1022                            dlFolderCacheModel.modifiedDate = modifiedDate.getTime();
1023                    }
1024                    else {
1025                            dlFolderCacheModel.modifiedDate = Long.MIN_VALUE;
1026                    }
1027    
1028                    dlFolderCacheModel.repositoryId = getRepositoryId();
1029    
1030                    dlFolderCacheModel.mountPoint = getMountPoint();
1031    
1032                    dlFolderCacheModel.parentFolderId = getParentFolderId();
1033    
1034                    dlFolderCacheModel.name = getName();
1035    
1036                    String name = dlFolderCacheModel.name;
1037    
1038                    if ((name != null) && (name.length() == 0)) {
1039                            dlFolderCacheModel.name = null;
1040                    }
1041    
1042                    dlFolderCacheModel.description = getDescription();
1043    
1044                    String description = dlFolderCacheModel.description;
1045    
1046                    if ((description != null) && (description.length() == 0)) {
1047                            dlFolderCacheModel.description = null;
1048                    }
1049    
1050                    Date lastPostDate = getLastPostDate();
1051    
1052                    if (lastPostDate != null) {
1053                            dlFolderCacheModel.lastPostDate = lastPostDate.getTime();
1054                    }
1055                    else {
1056                            dlFolderCacheModel.lastPostDate = Long.MIN_VALUE;
1057                    }
1058    
1059                    dlFolderCacheModel.defaultFileEntryTypeId = getDefaultFileEntryTypeId();
1060    
1061                    dlFolderCacheModel.hidden = getHidden();
1062    
1063                    dlFolderCacheModel.overrideFileEntryTypes = getOverrideFileEntryTypes();
1064    
1065                    dlFolderCacheModel.status = getStatus();
1066    
1067                    dlFolderCacheModel.statusByUserId = getStatusByUserId();
1068    
1069                    dlFolderCacheModel.statusByUserName = getStatusByUserName();
1070    
1071                    String statusByUserName = dlFolderCacheModel.statusByUserName;
1072    
1073                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
1074                            dlFolderCacheModel.statusByUserName = null;
1075                    }
1076    
1077                    Date statusDate = getStatusDate();
1078    
1079                    if (statusDate != null) {
1080                            dlFolderCacheModel.statusDate = statusDate.getTime();
1081                    }
1082                    else {
1083                            dlFolderCacheModel.statusDate = Long.MIN_VALUE;
1084                    }
1085    
1086                    return dlFolderCacheModel;
1087            }
1088    
1089            @Override
1090            public String toString() {
1091                    StringBundler sb = new StringBundler(43);
1092    
1093                    sb.append("{uuid=");
1094                    sb.append(getUuid());
1095                    sb.append(", folderId=");
1096                    sb.append(getFolderId());
1097                    sb.append(", groupId=");
1098                    sb.append(getGroupId());
1099                    sb.append(", companyId=");
1100                    sb.append(getCompanyId());
1101                    sb.append(", userId=");
1102                    sb.append(getUserId());
1103                    sb.append(", userName=");
1104                    sb.append(getUserName());
1105                    sb.append(", createDate=");
1106                    sb.append(getCreateDate());
1107                    sb.append(", modifiedDate=");
1108                    sb.append(getModifiedDate());
1109                    sb.append(", repositoryId=");
1110                    sb.append(getRepositoryId());
1111                    sb.append(", mountPoint=");
1112                    sb.append(getMountPoint());
1113                    sb.append(", parentFolderId=");
1114                    sb.append(getParentFolderId());
1115                    sb.append(", name=");
1116                    sb.append(getName());
1117                    sb.append(", description=");
1118                    sb.append(getDescription());
1119                    sb.append(", lastPostDate=");
1120                    sb.append(getLastPostDate());
1121                    sb.append(", defaultFileEntryTypeId=");
1122                    sb.append(getDefaultFileEntryTypeId());
1123                    sb.append(", hidden=");
1124                    sb.append(getHidden());
1125                    sb.append(", overrideFileEntryTypes=");
1126                    sb.append(getOverrideFileEntryTypes());
1127                    sb.append(", status=");
1128                    sb.append(getStatus());
1129                    sb.append(", statusByUserId=");
1130                    sb.append(getStatusByUserId());
1131                    sb.append(", statusByUserName=");
1132                    sb.append(getStatusByUserName());
1133                    sb.append(", statusDate=");
1134                    sb.append(getStatusDate());
1135                    sb.append("}");
1136    
1137                    return sb.toString();
1138            }
1139    
1140            public String toXmlString() {
1141                    StringBundler sb = new StringBundler(67);
1142    
1143                    sb.append("<model><model-name>");
1144                    sb.append("com.liferay.portlet.documentlibrary.model.DLFolder");
1145                    sb.append("</model-name>");
1146    
1147                    sb.append(
1148                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1149                    sb.append(getUuid());
1150                    sb.append("]]></column-value></column>");
1151                    sb.append(
1152                            "<column><column-name>folderId</column-name><column-value><![CDATA[");
1153                    sb.append(getFolderId());
1154                    sb.append("]]></column-value></column>");
1155                    sb.append(
1156                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1157                    sb.append(getGroupId());
1158                    sb.append("]]></column-value></column>");
1159                    sb.append(
1160                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1161                    sb.append(getCompanyId());
1162                    sb.append("]]></column-value></column>");
1163                    sb.append(
1164                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1165                    sb.append(getUserId());
1166                    sb.append("]]></column-value></column>");
1167                    sb.append(
1168                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1169                    sb.append(getUserName());
1170                    sb.append("]]></column-value></column>");
1171                    sb.append(
1172                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1173                    sb.append(getCreateDate());
1174                    sb.append("]]></column-value></column>");
1175                    sb.append(
1176                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1177                    sb.append(getModifiedDate());
1178                    sb.append("]]></column-value></column>");
1179                    sb.append(
1180                            "<column><column-name>repositoryId</column-name><column-value><![CDATA[");
1181                    sb.append(getRepositoryId());
1182                    sb.append("]]></column-value></column>");
1183                    sb.append(
1184                            "<column><column-name>mountPoint</column-name><column-value><![CDATA[");
1185                    sb.append(getMountPoint());
1186                    sb.append("]]></column-value></column>");
1187                    sb.append(
1188                            "<column><column-name>parentFolderId</column-name><column-value><![CDATA[");
1189                    sb.append(getParentFolderId());
1190                    sb.append("]]></column-value></column>");
1191                    sb.append(
1192                            "<column><column-name>name</column-name><column-value><![CDATA[");
1193                    sb.append(getName());
1194                    sb.append("]]></column-value></column>");
1195                    sb.append(
1196                            "<column><column-name>description</column-name><column-value><![CDATA[");
1197                    sb.append(getDescription());
1198                    sb.append("]]></column-value></column>");
1199                    sb.append(
1200                            "<column><column-name>lastPostDate</column-name><column-value><![CDATA[");
1201                    sb.append(getLastPostDate());
1202                    sb.append("]]></column-value></column>");
1203                    sb.append(
1204                            "<column><column-name>defaultFileEntryTypeId</column-name><column-value><![CDATA[");
1205                    sb.append(getDefaultFileEntryTypeId());
1206                    sb.append("]]></column-value></column>");
1207                    sb.append(
1208                            "<column><column-name>hidden</column-name><column-value><![CDATA[");
1209                    sb.append(getHidden());
1210                    sb.append("]]></column-value></column>");
1211                    sb.append(
1212                            "<column><column-name>overrideFileEntryTypes</column-name><column-value><![CDATA[");
1213                    sb.append(getOverrideFileEntryTypes());
1214                    sb.append("]]></column-value></column>");
1215                    sb.append(
1216                            "<column><column-name>status</column-name><column-value><![CDATA[");
1217                    sb.append(getStatus());
1218                    sb.append("]]></column-value></column>");
1219                    sb.append(
1220                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1221                    sb.append(getStatusByUserId());
1222                    sb.append("]]></column-value></column>");
1223                    sb.append(
1224                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1225                    sb.append(getStatusByUserName());
1226                    sb.append("]]></column-value></column>");
1227                    sb.append(
1228                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1229                    sb.append(getStatusDate());
1230                    sb.append("]]></column-value></column>");
1231    
1232                    sb.append("</model>");
1233    
1234                    return sb.toString();
1235            }
1236    
1237            private static ClassLoader _classLoader = DLFolder.class.getClassLoader();
1238            private static Class<?>[] _escapedModelInterfaces = new Class[] {
1239                            DLFolder.class
1240                    };
1241            private String _uuid;
1242            private String _originalUuid;
1243            private long _folderId;
1244            private long _groupId;
1245            private long _originalGroupId;
1246            private boolean _setOriginalGroupId;
1247            private long _companyId;
1248            private long _originalCompanyId;
1249            private boolean _setOriginalCompanyId;
1250            private long _userId;
1251            private String _userUuid;
1252            private String _userName;
1253            private Date _createDate;
1254            private Date _modifiedDate;
1255            private long _repositoryId;
1256            private long _originalRepositoryId;
1257            private boolean _setOriginalRepositoryId;
1258            private boolean _mountPoint;
1259            private boolean _originalMountPoint;
1260            private boolean _setOriginalMountPoint;
1261            private long _parentFolderId;
1262            private long _originalParentFolderId;
1263            private boolean _setOriginalParentFolderId;
1264            private String _name;
1265            private String _originalName;
1266            private String _description;
1267            private Date _lastPostDate;
1268            private long _defaultFileEntryTypeId;
1269            private boolean _hidden;
1270            private boolean _originalHidden;
1271            private boolean _setOriginalHidden;
1272            private boolean _overrideFileEntryTypes;
1273            private int _status;
1274            private int _originalStatus;
1275            private boolean _setOriginalStatus;
1276            private long _statusByUserId;
1277            private String _statusByUserUuid;
1278            private String _statusByUserName;
1279            private Date _statusDate;
1280            private long _columnBitmask;
1281            private DLFolder _escapedModel;
1282    }