001
014
015 package com.liferay.portlet.documentlibrary.model.impl;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.NoSuchModelException;
020 import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
021 import com.liferay.portal.kernel.exception.PortalException;
022 import com.liferay.portal.kernel.json.JSON;
023 import com.liferay.portal.kernel.trash.TrashHandler;
024 import com.liferay.portal.kernel.trash.TrashHandlerRegistryUtil;
025 import com.liferay.portal.kernel.util.GetterUtil;
026 import com.liferay.portal.kernel.util.ProxyUtil;
027 import com.liferay.portal.kernel.util.StringBundler;
028 import com.liferay.portal.kernel.util.StringPool;
029 import com.liferay.portal.kernel.util.Validator;
030 import com.liferay.portal.kernel.workflow.WorkflowConstants;
031 import com.liferay.portal.model.CacheModel;
032 import com.liferay.portal.model.ContainerModel;
033 import com.liferay.portal.model.TrashedModel;
034 import com.liferay.portal.model.User;
035 import com.liferay.portal.model.impl.BaseModelImpl;
036 import com.liferay.portal.service.ServiceContext;
037 import com.liferay.portal.service.UserLocalServiceUtil;
038 import com.liferay.portal.util.PortalUtil;
039
040 import com.liferay.portlet.documentlibrary.model.DLFileShortcut;
041 import com.liferay.portlet.documentlibrary.model.DLFileShortcutModel;
042 import com.liferay.portlet.documentlibrary.model.DLFileShortcutSoap;
043 import com.liferay.portlet.expando.model.ExpandoBridge;
044 import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
045 import com.liferay.portlet.exportimport.lar.StagedModelType;
046 import com.liferay.portlet.trash.model.TrashEntry;
047 import com.liferay.portlet.trash.service.TrashEntryLocalServiceUtil;
048
049 import java.io.Serializable;
050
051 import java.sql.Types;
052
053 import java.util.ArrayList;
054 import java.util.Date;
055 import java.util.HashMap;
056 import java.util.List;
057 import java.util.Map;
058
059
072 @JSON(strict = true)
073 @ProviderType
074 public class DLFileShortcutModelImpl extends BaseModelImpl<DLFileShortcut>
075 implements DLFileShortcutModel {
076
081 public static final String TABLE_NAME = "DLFileShortcut";
082 public static final Object[][] TABLE_COLUMNS = {
083 { "uuid_", Types.VARCHAR },
084 { "fileShortcutId", Types.BIGINT },
085 { "groupId", Types.BIGINT },
086 { "companyId", Types.BIGINT },
087 { "userId", Types.BIGINT },
088 { "userName", Types.VARCHAR },
089 { "createDate", Types.TIMESTAMP },
090 { "modifiedDate", Types.TIMESTAMP },
091 { "repositoryId", Types.BIGINT },
092 { "folderId", Types.BIGINT },
093 { "toFileEntryId", Types.BIGINT },
094 { "treePath", Types.VARCHAR },
095 { "active_", Types.BOOLEAN },
096 { "lastPublishDate", Types.TIMESTAMP },
097 { "status", Types.INTEGER },
098 { "statusByUserId", Types.BIGINT },
099 { "statusByUserName", Types.VARCHAR },
100 { "statusDate", Types.TIMESTAMP }
101 };
102 public static final Map<String, Integer> TABLE_COLUMNS_MAP = new HashMap<String, Integer>();
103
104 static {
105 TABLE_COLUMNS_MAP.put("uuid_", Types.VARCHAR);
106 TABLE_COLUMNS_MAP.put("fileShortcutId", Types.BIGINT);
107 TABLE_COLUMNS_MAP.put("groupId", Types.BIGINT);
108 TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT);
109 TABLE_COLUMNS_MAP.put("userId", Types.BIGINT);
110 TABLE_COLUMNS_MAP.put("userName", Types.VARCHAR);
111 TABLE_COLUMNS_MAP.put("createDate", Types.TIMESTAMP);
112 TABLE_COLUMNS_MAP.put("modifiedDate", Types.TIMESTAMP);
113 TABLE_COLUMNS_MAP.put("repositoryId", Types.BIGINT);
114 TABLE_COLUMNS_MAP.put("folderId", Types.BIGINT);
115 TABLE_COLUMNS_MAP.put("toFileEntryId", Types.BIGINT);
116 TABLE_COLUMNS_MAP.put("treePath", Types.VARCHAR);
117 TABLE_COLUMNS_MAP.put("active_", Types.BOOLEAN);
118 TABLE_COLUMNS_MAP.put("lastPublishDate", Types.TIMESTAMP);
119 TABLE_COLUMNS_MAP.put("status", Types.INTEGER);
120 TABLE_COLUMNS_MAP.put("statusByUserId", Types.BIGINT);
121 TABLE_COLUMNS_MAP.put("statusByUserName", Types.VARCHAR);
122 TABLE_COLUMNS_MAP.put("statusDate", Types.TIMESTAMP);
123 }
124
125 public static final String TABLE_SQL_CREATE = "create table DLFileShortcut (uuid_ VARCHAR(75) null,fileShortcutId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,repositoryId LONG,folderId LONG,toFileEntryId LONG,treePath STRING null,active_ BOOLEAN,lastPublishDate DATE null,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
126 public static final String TABLE_SQL_DROP = "drop table DLFileShortcut";
127 public static final String ORDER_BY_JPQL = " ORDER BY dlFileShortcut.fileShortcutId ASC";
128 public static final String ORDER_BY_SQL = " ORDER BY DLFileShortcut.fileShortcutId ASC";
129 public static final String DATA_SOURCE = "liferayDataSource";
130 public static final String SESSION_FACTORY = "liferaySessionFactory";
131 public static final String TX_MANAGER = "liferayTransactionManager";
132 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
133 "value.object.entity.cache.enabled.com.liferay.portlet.documentlibrary.model.DLFileShortcut"),
134 true);
135 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
136 "value.object.finder.cache.enabled.com.liferay.portlet.documentlibrary.model.DLFileShortcut"),
137 true);
138 public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
139 "value.object.column.bitmask.enabled.com.liferay.portlet.documentlibrary.model.DLFileShortcut"),
140 true);
141 public static final long ACTIVE_COLUMN_BITMASK = 1L;
142 public static final long COMPANYID_COLUMN_BITMASK = 2L;
143 public static final long FOLDERID_COLUMN_BITMASK = 4L;
144 public static final long GROUPID_COLUMN_BITMASK = 8L;
145 public static final long STATUS_COLUMN_BITMASK = 16L;
146 public static final long TOFILEENTRYID_COLUMN_BITMASK = 32L;
147 public static final long UUID_COLUMN_BITMASK = 64L;
148 public static final long FILESHORTCUTID_COLUMN_BITMASK = 128L;
149
150
156 public static DLFileShortcut toModel(DLFileShortcutSoap soapModel) {
157 if (soapModel == null) {
158 return null;
159 }
160
161 DLFileShortcut model = new DLFileShortcutImpl();
162
163 model.setUuid(soapModel.getUuid());
164 model.setFileShortcutId(soapModel.getFileShortcutId());
165 model.setGroupId(soapModel.getGroupId());
166 model.setCompanyId(soapModel.getCompanyId());
167 model.setUserId(soapModel.getUserId());
168 model.setUserName(soapModel.getUserName());
169 model.setCreateDate(soapModel.getCreateDate());
170 model.setModifiedDate(soapModel.getModifiedDate());
171 model.setRepositoryId(soapModel.getRepositoryId());
172 model.setFolderId(soapModel.getFolderId());
173 model.setToFileEntryId(soapModel.getToFileEntryId());
174 model.setTreePath(soapModel.getTreePath());
175 model.setActive(soapModel.getActive());
176 model.setLastPublishDate(soapModel.getLastPublishDate());
177 model.setStatus(soapModel.getStatus());
178 model.setStatusByUserId(soapModel.getStatusByUserId());
179 model.setStatusByUserName(soapModel.getStatusByUserName());
180 model.setStatusDate(soapModel.getStatusDate());
181
182 return model;
183 }
184
185
191 public static List<DLFileShortcut> toModels(DLFileShortcutSoap[] soapModels) {
192 if (soapModels == null) {
193 return null;
194 }
195
196 List<DLFileShortcut> models = new ArrayList<DLFileShortcut>(soapModels.length);
197
198 for (DLFileShortcutSoap soapModel : soapModels) {
199 models.add(toModel(soapModel));
200 }
201
202 return models;
203 }
204
205 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
206 "lock.expiration.time.com.liferay.portlet.documentlibrary.model.DLFileShortcut"));
207
208 public DLFileShortcutModelImpl() {
209 }
210
211 @Override
212 public long getPrimaryKey() {
213 return _fileShortcutId;
214 }
215
216 @Override
217 public void setPrimaryKey(long primaryKey) {
218 setFileShortcutId(primaryKey);
219 }
220
221 @Override
222 public Serializable getPrimaryKeyObj() {
223 return _fileShortcutId;
224 }
225
226 @Override
227 public void setPrimaryKeyObj(Serializable primaryKeyObj) {
228 setPrimaryKey(((Long)primaryKeyObj).longValue());
229 }
230
231 @Override
232 public Class<?> getModelClass() {
233 return DLFileShortcut.class;
234 }
235
236 @Override
237 public String getModelClassName() {
238 return DLFileShortcut.class.getName();
239 }
240
241 @Override
242 public Map<String, Object> getModelAttributes() {
243 Map<String, Object> attributes = new HashMap<String, Object>();
244
245 attributes.put("uuid", getUuid());
246 attributes.put("fileShortcutId", getFileShortcutId());
247 attributes.put("groupId", getGroupId());
248 attributes.put("companyId", getCompanyId());
249 attributes.put("userId", getUserId());
250 attributes.put("userName", getUserName());
251 attributes.put("createDate", getCreateDate());
252 attributes.put("modifiedDate", getModifiedDate());
253 attributes.put("repositoryId", getRepositoryId());
254 attributes.put("folderId", getFolderId());
255 attributes.put("toFileEntryId", getToFileEntryId());
256 attributes.put("treePath", getTreePath());
257 attributes.put("active", getActive());
258 attributes.put("lastPublishDate", getLastPublishDate());
259 attributes.put("status", getStatus());
260 attributes.put("statusByUserId", getStatusByUserId());
261 attributes.put("statusByUserName", getStatusByUserName());
262 attributes.put("statusDate", getStatusDate());
263
264 attributes.put("entityCacheEnabled", isEntityCacheEnabled());
265 attributes.put("finderCacheEnabled", isFinderCacheEnabled());
266
267 return attributes;
268 }
269
270 @Override
271 public void setModelAttributes(Map<String, Object> attributes) {
272 String uuid = (String)attributes.get("uuid");
273
274 if (uuid != null) {
275 setUuid(uuid);
276 }
277
278 Long fileShortcutId = (Long)attributes.get("fileShortcutId");
279
280 if (fileShortcutId != null) {
281 setFileShortcutId(fileShortcutId);
282 }
283
284 Long groupId = (Long)attributes.get("groupId");
285
286 if (groupId != null) {
287 setGroupId(groupId);
288 }
289
290 Long companyId = (Long)attributes.get("companyId");
291
292 if (companyId != null) {
293 setCompanyId(companyId);
294 }
295
296 Long userId = (Long)attributes.get("userId");
297
298 if (userId != null) {
299 setUserId(userId);
300 }
301
302 String userName = (String)attributes.get("userName");
303
304 if (userName != null) {
305 setUserName(userName);
306 }
307
308 Date createDate = (Date)attributes.get("createDate");
309
310 if (createDate != null) {
311 setCreateDate(createDate);
312 }
313
314 Date modifiedDate = (Date)attributes.get("modifiedDate");
315
316 if (modifiedDate != null) {
317 setModifiedDate(modifiedDate);
318 }
319
320 Long repositoryId = (Long)attributes.get("repositoryId");
321
322 if (repositoryId != null) {
323 setRepositoryId(repositoryId);
324 }
325
326 Long folderId = (Long)attributes.get("folderId");
327
328 if (folderId != null) {
329 setFolderId(folderId);
330 }
331
332 Long toFileEntryId = (Long)attributes.get("toFileEntryId");
333
334 if (toFileEntryId != null) {
335 setToFileEntryId(toFileEntryId);
336 }
337
338 String treePath = (String)attributes.get("treePath");
339
340 if (treePath != null) {
341 setTreePath(treePath);
342 }
343
344 Boolean active = (Boolean)attributes.get("active");
345
346 if (active != null) {
347 setActive(active);
348 }
349
350 Date lastPublishDate = (Date)attributes.get("lastPublishDate");
351
352 if (lastPublishDate != null) {
353 setLastPublishDate(lastPublishDate);
354 }
355
356 Integer status = (Integer)attributes.get("status");
357
358 if (status != null) {
359 setStatus(status);
360 }
361
362 Long statusByUserId = (Long)attributes.get("statusByUserId");
363
364 if (statusByUserId != null) {
365 setStatusByUserId(statusByUserId);
366 }
367
368 String statusByUserName = (String)attributes.get("statusByUserName");
369
370 if (statusByUserName != null) {
371 setStatusByUserName(statusByUserName);
372 }
373
374 Date statusDate = (Date)attributes.get("statusDate");
375
376 if (statusDate != null) {
377 setStatusDate(statusDate);
378 }
379 }
380
381 @JSON
382 @Override
383 public String getUuid() {
384 if (_uuid == null) {
385 return StringPool.BLANK;
386 }
387 else {
388 return _uuid;
389 }
390 }
391
392 @Override
393 public void setUuid(String uuid) {
394 if (_originalUuid == null) {
395 _originalUuid = _uuid;
396 }
397
398 _uuid = uuid;
399 }
400
401 public String getOriginalUuid() {
402 return GetterUtil.getString(_originalUuid);
403 }
404
405 @JSON
406 @Override
407 public long getFileShortcutId() {
408 return _fileShortcutId;
409 }
410
411 @Override
412 public void setFileShortcutId(long fileShortcutId) {
413 _fileShortcutId = fileShortcutId;
414 }
415
416 @JSON
417 @Override
418 public long getGroupId() {
419 return _groupId;
420 }
421
422 @Override
423 public void setGroupId(long groupId) {
424 _columnBitmask |= GROUPID_COLUMN_BITMASK;
425
426 if (!_setOriginalGroupId) {
427 _setOriginalGroupId = true;
428
429 _originalGroupId = _groupId;
430 }
431
432 _groupId = groupId;
433 }
434
435 public long getOriginalGroupId() {
436 return _originalGroupId;
437 }
438
439 @JSON
440 @Override
441 public long getCompanyId() {
442 return _companyId;
443 }
444
445 @Override
446 public void setCompanyId(long companyId) {
447 _columnBitmask |= COMPANYID_COLUMN_BITMASK;
448
449 if (!_setOriginalCompanyId) {
450 _setOriginalCompanyId = true;
451
452 _originalCompanyId = _companyId;
453 }
454
455 _companyId = companyId;
456 }
457
458 public long getOriginalCompanyId() {
459 return _originalCompanyId;
460 }
461
462 @JSON
463 @Override
464 public long getUserId() {
465 return _userId;
466 }
467
468 @Override
469 public void setUserId(long userId) {
470 _userId = userId;
471 }
472
473 @Override
474 public String getUserUuid() {
475 try {
476 User user = UserLocalServiceUtil.getUserById(getUserId());
477
478 return user.getUuid();
479 }
480 catch (PortalException pe) {
481 return StringPool.BLANK;
482 }
483 }
484
485 @Override
486 public void setUserUuid(String userUuid) {
487 }
488
489 @JSON
490 @Override
491 public String getUserName() {
492 if (_userName == null) {
493 return StringPool.BLANK;
494 }
495 else {
496 return _userName;
497 }
498 }
499
500 @Override
501 public void setUserName(String userName) {
502 _userName = userName;
503 }
504
505 @JSON
506 @Override
507 public Date getCreateDate() {
508 return _createDate;
509 }
510
511 @Override
512 public void setCreateDate(Date createDate) {
513 _createDate = createDate;
514 }
515
516 @JSON
517 @Override
518 public Date getModifiedDate() {
519 return _modifiedDate;
520 }
521
522 public boolean hasSetModifiedDate() {
523 return _setModifiedDate;
524 }
525
526 @Override
527 public void setModifiedDate(Date modifiedDate) {
528 _setModifiedDate = true;
529
530 _modifiedDate = modifiedDate;
531 }
532
533 @JSON
534 @Override
535 public long getRepositoryId() {
536 return _repositoryId;
537 }
538
539 @Override
540 public void setRepositoryId(long repositoryId) {
541 _repositoryId = repositoryId;
542 }
543
544 @JSON
545 @Override
546 public long getFolderId() {
547 return _folderId;
548 }
549
550 @Override
551 public void setFolderId(long folderId) {
552 _columnBitmask |= FOLDERID_COLUMN_BITMASK;
553
554 if (!_setOriginalFolderId) {
555 _setOriginalFolderId = true;
556
557 _originalFolderId = _folderId;
558 }
559
560 _folderId = folderId;
561 }
562
563 public long getOriginalFolderId() {
564 return _originalFolderId;
565 }
566
567 @JSON
568 @Override
569 public long getToFileEntryId() {
570 return _toFileEntryId;
571 }
572
573 @Override
574 public void setToFileEntryId(long toFileEntryId) {
575 _columnBitmask |= TOFILEENTRYID_COLUMN_BITMASK;
576
577 if (!_setOriginalToFileEntryId) {
578 _setOriginalToFileEntryId = true;
579
580 _originalToFileEntryId = _toFileEntryId;
581 }
582
583 _toFileEntryId = toFileEntryId;
584 }
585
586 public long getOriginalToFileEntryId() {
587 return _originalToFileEntryId;
588 }
589
590 @JSON
591 @Override
592 public String getTreePath() {
593 if (_treePath == null) {
594 return StringPool.BLANK;
595 }
596 else {
597 return _treePath;
598 }
599 }
600
601 @Override
602 public void setTreePath(String treePath) {
603 _treePath = treePath;
604 }
605
606 @JSON
607 @Override
608 public boolean getActive() {
609 return _active;
610 }
611
612 @Override
613 public boolean isActive() {
614 return _active;
615 }
616
617 @Override
618 public void setActive(boolean active) {
619 _columnBitmask |= ACTIVE_COLUMN_BITMASK;
620
621 if (!_setOriginalActive) {
622 _setOriginalActive = true;
623
624 _originalActive = _active;
625 }
626
627 _active = active;
628 }
629
630 public boolean getOriginalActive() {
631 return _originalActive;
632 }
633
634 @JSON
635 @Override
636 public Date getLastPublishDate() {
637 return _lastPublishDate;
638 }
639
640 @Override
641 public void setLastPublishDate(Date lastPublishDate) {
642 _lastPublishDate = lastPublishDate;
643 }
644
645 @JSON
646 @Override
647 public int getStatus() {
648 return _status;
649 }
650
651 @Override
652 public void setStatus(int status) {
653 _columnBitmask |= STATUS_COLUMN_BITMASK;
654
655 if (!_setOriginalStatus) {
656 _setOriginalStatus = true;
657
658 _originalStatus = _status;
659 }
660
661 _status = status;
662 }
663
664 public int getOriginalStatus() {
665 return _originalStatus;
666 }
667
668 @JSON
669 @Override
670 public long getStatusByUserId() {
671 return _statusByUserId;
672 }
673
674 @Override
675 public void setStatusByUserId(long statusByUserId) {
676 _statusByUserId = statusByUserId;
677 }
678
679 @Override
680 public String getStatusByUserUuid() {
681 try {
682 User user = UserLocalServiceUtil.getUserById(getStatusByUserId());
683
684 return user.getUuid();
685 }
686 catch (PortalException pe) {
687 return StringPool.BLANK;
688 }
689 }
690
691 @Override
692 public void setStatusByUserUuid(String statusByUserUuid) {
693 }
694
695 @JSON
696 @Override
697 public String getStatusByUserName() {
698 if (_statusByUserName == null) {
699 return StringPool.BLANK;
700 }
701 else {
702 return _statusByUserName;
703 }
704 }
705
706 @Override
707 public void setStatusByUserName(String statusByUserName) {
708 _statusByUserName = statusByUserName;
709 }
710
711 @JSON
712 @Override
713 public Date getStatusDate() {
714 return _statusDate;
715 }
716
717 @Override
718 public void setStatusDate(Date statusDate) {
719 _statusDate = statusDate;
720 }
721
722 @Override
723 public StagedModelType getStagedModelType() {
724 return new StagedModelType(PortalUtil.getClassNameId(
725 DLFileShortcut.class.getName()));
726 }
727
728 @Override
729 public TrashEntry getTrashEntry() throws PortalException {
730 if (!isInTrash()) {
731 return null;
732 }
733
734 TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(),
735 getTrashEntryClassPK());
736
737 if (trashEntry != null) {
738 return trashEntry;
739 }
740
741 TrashHandler trashHandler = getTrashHandler();
742
743 if (!Validator.isNull(trashHandler.getContainerModelClassName(
744 getPrimaryKey()))) {
745 ContainerModel containerModel = null;
746
747 try {
748 containerModel = trashHandler.getParentContainerModel(this);
749 }
750 catch (NoSuchModelException nsme) {
751 return null;
752 }
753
754 while (containerModel != null) {
755 if (containerModel instanceof TrashedModel) {
756 TrashedModel trashedModel = (TrashedModel)containerModel;
757
758 return trashedModel.getTrashEntry();
759 }
760
761 trashHandler = TrashHandlerRegistryUtil.getTrashHandler(trashHandler.getContainerModelClassName(
762 containerModel.getContainerModelId()));
763
764 if (trashHandler == null) {
765 return null;
766 }
767
768 containerModel = trashHandler.getContainerModel(containerModel.getParentContainerModelId());
769 }
770 }
771
772 return null;
773 }
774
775 @Override
776 public long getTrashEntryClassPK() {
777 return getPrimaryKey();
778 }
779
780 @Override
781 public TrashHandler getTrashHandler() {
782 return TrashHandlerRegistryUtil.getTrashHandler(getModelClassName());
783 }
784
785 @Override
786 public boolean isInTrash() {
787 if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
788 return true;
789 }
790 else {
791 return false;
792 }
793 }
794
795 @Override
796 public boolean isInTrashContainer() {
797 TrashHandler trashHandler = getTrashHandler();
798
799 if ((trashHandler == null) ||
800 Validator.isNull(trashHandler.getContainerModelClassName(
801 getPrimaryKey()))) {
802 return false;
803 }
804
805 try {
806 ContainerModel containerModel = trashHandler.getParentContainerModel(this);
807
808 if (containerModel == null) {
809 return false;
810 }
811
812 if (containerModel instanceof TrashedModel) {
813 return ((TrashedModel)containerModel).isInTrash();
814 }
815 }
816 catch (Exception e) {
817 }
818
819 return false;
820 }
821
822 @Override
823 public boolean isInTrashExplicitly() {
824 if (!isInTrash()) {
825 return false;
826 }
827
828 TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(),
829 getTrashEntryClassPK());
830
831 if (trashEntry != null) {
832 return true;
833 }
834
835 return false;
836 }
837
838 @Override
839 public boolean isInTrashImplicitly() {
840 if (!isInTrash()) {
841 return false;
842 }
843
844 TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(),
845 getTrashEntryClassPK());
846
847 if (trashEntry != null) {
848 return false;
849 }
850
851 return true;
852 }
853
854
857 @Deprecated
858 @Override
859 public boolean getApproved() {
860 return isApproved();
861 }
862
863 @Override
864 public boolean isApproved() {
865 if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
866 return true;
867 }
868 else {
869 return false;
870 }
871 }
872
873 @Override
874 public boolean isDenied() {
875 if (getStatus() == WorkflowConstants.STATUS_DENIED) {
876 return true;
877 }
878 else {
879 return false;
880 }
881 }
882
883 @Override
884 public boolean isDraft() {
885 if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
886 return true;
887 }
888 else {
889 return false;
890 }
891 }
892
893 @Override
894 public boolean isExpired() {
895 if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
896 return true;
897 }
898 else {
899 return false;
900 }
901 }
902
903 @Override
904 public boolean isInactive() {
905 if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
906 return true;
907 }
908 else {
909 return false;
910 }
911 }
912
913 @Override
914 public boolean isIncomplete() {
915 if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
916 return true;
917 }
918 else {
919 return false;
920 }
921 }
922
923 @Override
924 public boolean isPending() {
925 if (getStatus() == WorkflowConstants.STATUS_PENDING) {
926 return true;
927 }
928 else {
929 return false;
930 }
931 }
932
933 @Override
934 public boolean isScheduled() {
935 if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
936 return true;
937 }
938 else {
939 return false;
940 }
941 }
942
943 public long getColumnBitmask() {
944 return _columnBitmask;
945 }
946
947 @Override
948 public ExpandoBridge getExpandoBridge() {
949 return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
950 DLFileShortcut.class.getName(), getPrimaryKey());
951 }
952
953 @Override
954 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
955 ExpandoBridge expandoBridge = getExpandoBridge();
956
957 expandoBridge.setAttributes(serviceContext);
958 }
959
960 @Override
961 public DLFileShortcut toEscapedModel() {
962 if (_escapedModel == null) {
963 _escapedModel = (DLFileShortcut)ProxyUtil.newProxyInstance(_classLoader,
964 _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
965 }
966
967 return _escapedModel;
968 }
969
970 @Override
971 public Object clone() {
972 DLFileShortcutImpl dlFileShortcutImpl = new DLFileShortcutImpl();
973
974 dlFileShortcutImpl.setUuid(getUuid());
975 dlFileShortcutImpl.setFileShortcutId(getFileShortcutId());
976 dlFileShortcutImpl.setGroupId(getGroupId());
977 dlFileShortcutImpl.setCompanyId(getCompanyId());
978 dlFileShortcutImpl.setUserId(getUserId());
979 dlFileShortcutImpl.setUserName(getUserName());
980 dlFileShortcutImpl.setCreateDate(getCreateDate());
981 dlFileShortcutImpl.setModifiedDate(getModifiedDate());
982 dlFileShortcutImpl.setRepositoryId(getRepositoryId());
983 dlFileShortcutImpl.setFolderId(getFolderId());
984 dlFileShortcutImpl.setToFileEntryId(getToFileEntryId());
985 dlFileShortcutImpl.setTreePath(getTreePath());
986 dlFileShortcutImpl.setActive(getActive());
987 dlFileShortcutImpl.setLastPublishDate(getLastPublishDate());
988 dlFileShortcutImpl.setStatus(getStatus());
989 dlFileShortcutImpl.setStatusByUserId(getStatusByUserId());
990 dlFileShortcutImpl.setStatusByUserName(getStatusByUserName());
991 dlFileShortcutImpl.setStatusDate(getStatusDate());
992
993 dlFileShortcutImpl.resetOriginalValues();
994
995 return dlFileShortcutImpl;
996 }
997
998 @Override
999 public int compareTo(DLFileShortcut dlFileShortcut) {
1000 long primaryKey = dlFileShortcut.getPrimaryKey();
1001
1002 if (getPrimaryKey() < primaryKey) {
1003 return -1;
1004 }
1005 else if (getPrimaryKey() > primaryKey) {
1006 return 1;
1007 }
1008 else {
1009 return 0;
1010 }
1011 }
1012
1013 @Override
1014 public boolean equals(Object obj) {
1015 if (this == obj) {
1016 return true;
1017 }
1018
1019 if (!(obj instanceof DLFileShortcut)) {
1020 return false;
1021 }
1022
1023 DLFileShortcut dlFileShortcut = (DLFileShortcut)obj;
1024
1025 long primaryKey = dlFileShortcut.getPrimaryKey();
1026
1027 if (getPrimaryKey() == primaryKey) {
1028 return true;
1029 }
1030 else {
1031 return false;
1032 }
1033 }
1034
1035 @Override
1036 public int hashCode() {
1037 return (int)getPrimaryKey();
1038 }
1039
1040 @Override
1041 public boolean isEntityCacheEnabled() {
1042 return ENTITY_CACHE_ENABLED;
1043 }
1044
1045 @Override
1046 public boolean isFinderCacheEnabled() {
1047 return FINDER_CACHE_ENABLED;
1048 }
1049
1050 @Override
1051 public void resetOriginalValues() {
1052 DLFileShortcutModelImpl dlFileShortcutModelImpl = this;
1053
1054 dlFileShortcutModelImpl._originalUuid = dlFileShortcutModelImpl._uuid;
1055
1056 dlFileShortcutModelImpl._originalGroupId = dlFileShortcutModelImpl._groupId;
1057
1058 dlFileShortcutModelImpl._setOriginalGroupId = false;
1059
1060 dlFileShortcutModelImpl._originalCompanyId = dlFileShortcutModelImpl._companyId;
1061
1062 dlFileShortcutModelImpl._setOriginalCompanyId = false;
1063
1064 dlFileShortcutModelImpl._setModifiedDate = false;
1065
1066 dlFileShortcutModelImpl._originalFolderId = dlFileShortcutModelImpl._folderId;
1067
1068 dlFileShortcutModelImpl._setOriginalFolderId = false;
1069
1070 dlFileShortcutModelImpl._originalToFileEntryId = dlFileShortcutModelImpl._toFileEntryId;
1071
1072 dlFileShortcutModelImpl._setOriginalToFileEntryId = false;
1073
1074 dlFileShortcutModelImpl._originalActive = dlFileShortcutModelImpl._active;
1075
1076 dlFileShortcutModelImpl._setOriginalActive = false;
1077
1078 dlFileShortcutModelImpl._originalStatus = dlFileShortcutModelImpl._status;
1079
1080 dlFileShortcutModelImpl._setOriginalStatus = false;
1081
1082 dlFileShortcutModelImpl._columnBitmask = 0;
1083 }
1084
1085 @Override
1086 public CacheModel<DLFileShortcut> toCacheModel() {
1087 DLFileShortcutCacheModel dlFileShortcutCacheModel = new DLFileShortcutCacheModel();
1088
1089 dlFileShortcutCacheModel.uuid = getUuid();
1090
1091 String uuid = dlFileShortcutCacheModel.uuid;
1092
1093 if ((uuid != null) && (uuid.length() == 0)) {
1094 dlFileShortcutCacheModel.uuid = null;
1095 }
1096
1097 dlFileShortcutCacheModel.fileShortcutId = getFileShortcutId();
1098
1099 dlFileShortcutCacheModel.groupId = getGroupId();
1100
1101 dlFileShortcutCacheModel.companyId = getCompanyId();
1102
1103 dlFileShortcutCacheModel.userId = getUserId();
1104
1105 dlFileShortcutCacheModel.userName = getUserName();
1106
1107 String userName = dlFileShortcutCacheModel.userName;
1108
1109 if ((userName != null) && (userName.length() == 0)) {
1110 dlFileShortcutCacheModel.userName = null;
1111 }
1112
1113 Date createDate = getCreateDate();
1114
1115 if (createDate != null) {
1116 dlFileShortcutCacheModel.createDate = createDate.getTime();
1117 }
1118 else {
1119 dlFileShortcutCacheModel.createDate = Long.MIN_VALUE;
1120 }
1121
1122 Date modifiedDate = getModifiedDate();
1123
1124 if (modifiedDate != null) {
1125 dlFileShortcutCacheModel.modifiedDate = modifiedDate.getTime();
1126 }
1127 else {
1128 dlFileShortcutCacheModel.modifiedDate = Long.MIN_VALUE;
1129 }
1130
1131 dlFileShortcutCacheModel.repositoryId = getRepositoryId();
1132
1133 dlFileShortcutCacheModel.folderId = getFolderId();
1134
1135 dlFileShortcutCacheModel.toFileEntryId = getToFileEntryId();
1136
1137 dlFileShortcutCacheModel.treePath = getTreePath();
1138
1139 String treePath = dlFileShortcutCacheModel.treePath;
1140
1141 if ((treePath != null) && (treePath.length() == 0)) {
1142 dlFileShortcutCacheModel.treePath = null;
1143 }
1144
1145 dlFileShortcutCacheModel.active = getActive();
1146
1147 Date lastPublishDate = getLastPublishDate();
1148
1149 if (lastPublishDate != null) {
1150 dlFileShortcutCacheModel.lastPublishDate = lastPublishDate.getTime();
1151 }
1152 else {
1153 dlFileShortcutCacheModel.lastPublishDate = Long.MIN_VALUE;
1154 }
1155
1156 dlFileShortcutCacheModel.status = getStatus();
1157
1158 dlFileShortcutCacheModel.statusByUserId = getStatusByUserId();
1159
1160 dlFileShortcutCacheModel.statusByUserName = getStatusByUserName();
1161
1162 String statusByUserName = dlFileShortcutCacheModel.statusByUserName;
1163
1164 if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
1165 dlFileShortcutCacheModel.statusByUserName = null;
1166 }
1167
1168 Date statusDate = getStatusDate();
1169
1170 if (statusDate != null) {
1171 dlFileShortcutCacheModel.statusDate = statusDate.getTime();
1172 }
1173 else {
1174 dlFileShortcutCacheModel.statusDate = Long.MIN_VALUE;
1175 }
1176
1177 return dlFileShortcutCacheModel;
1178 }
1179
1180 @Override
1181 public String toString() {
1182 StringBundler sb = new StringBundler(37);
1183
1184 sb.append("{uuid=");
1185 sb.append(getUuid());
1186 sb.append(", fileShortcutId=");
1187 sb.append(getFileShortcutId());
1188 sb.append(", groupId=");
1189 sb.append(getGroupId());
1190 sb.append(", companyId=");
1191 sb.append(getCompanyId());
1192 sb.append(", userId=");
1193 sb.append(getUserId());
1194 sb.append(", userName=");
1195 sb.append(getUserName());
1196 sb.append(", createDate=");
1197 sb.append(getCreateDate());
1198 sb.append(", modifiedDate=");
1199 sb.append(getModifiedDate());
1200 sb.append(", repositoryId=");
1201 sb.append(getRepositoryId());
1202 sb.append(", folderId=");
1203 sb.append(getFolderId());
1204 sb.append(", toFileEntryId=");
1205 sb.append(getToFileEntryId());
1206 sb.append(", treePath=");
1207 sb.append(getTreePath());
1208 sb.append(", active=");
1209 sb.append(getActive());
1210 sb.append(", lastPublishDate=");
1211 sb.append(getLastPublishDate());
1212 sb.append(", status=");
1213 sb.append(getStatus());
1214 sb.append(", statusByUserId=");
1215 sb.append(getStatusByUserId());
1216 sb.append(", statusByUserName=");
1217 sb.append(getStatusByUserName());
1218 sb.append(", statusDate=");
1219 sb.append(getStatusDate());
1220 sb.append("}");
1221
1222 return sb.toString();
1223 }
1224
1225 @Override
1226 public String toXmlString() {
1227 StringBundler sb = new StringBundler(58);
1228
1229 sb.append("<model><model-name>");
1230 sb.append("com.liferay.portlet.documentlibrary.model.DLFileShortcut");
1231 sb.append("</model-name>");
1232
1233 sb.append(
1234 "<column><column-name>uuid</column-name><column-value><![CDATA[");
1235 sb.append(getUuid());
1236 sb.append("]]></column-value></column>");
1237 sb.append(
1238 "<column><column-name>fileShortcutId</column-name><column-value><![CDATA[");
1239 sb.append(getFileShortcutId());
1240 sb.append("]]></column-value></column>");
1241 sb.append(
1242 "<column><column-name>groupId</column-name><column-value><![CDATA[");
1243 sb.append(getGroupId());
1244 sb.append("]]></column-value></column>");
1245 sb.append(
1246 "<column><column-name>companyId</column-name><column-value><![CDATA[");
1247 sb.append(getCompanyId());
1248 sb.append("]]></column-value></column>");
1249 sb.append(
1250 "<column><column-name>userId</column-name><column-value><![CDATA[");
1251 sb.append(getUserId());
1252 sb.append("]]></column-value></column>");
1253 sb.append(
1254 "<column><column-name>userName</column-name><column-value><![CDATA[");
1255 sb.append(getUserName());
1256 sb.append("]]></column-value></column>");
1257 sb.append(
1258 "<column><column-name>createDate</column-name><column-value><![CDATA[");
1259 sb.append(getCreateDate());
1260 sb.append("]]></column-value></column>");
1261 sb.append(
1262 "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1263 sb.append(getModifiedDate());
1264 sb.append("]]></column-value></column>");
1265 sb.append(
1266 "<column><column-name>repositoryId</column-name><column-value><![CDATA[");
1267 sb.append(getRepositoryId());
1268 sb.append("]]></column-value></column>");
1269 sb.append(
1270 "<column><column-name>folderId</column-name><column-value><![CDATA[");
1271 sb.append(getFolderId());
1272 sb.append("]]></column-value></column>");
1273 sb.append(
1274 "<column><column-name>toFileEntryId</column-name><column-value><![CDATA[");
1275 sb.append(getToFileEntryId());
1276 sb.append("]]></column-value></column>");
1277 sb.append(
1278 "<column><column-name>treePath</column-name><column-value><![CDATA[");
1279 sb.append(getTreePath());
1280 sb.append("]]></column-value></column>");
1281 sb.append(
1282 "<column><column-name>active</column-name><column-value><![CDATA[");
1283 sb.append(getActive());
1284 sb.append("]]></column-value></column>");
1285 sb.append(
1286 "<column><column-name>lastPublishDate</column-name><column-value><![CDATA[");
1287 sb.append(getLastPublishDate());
1288 sb.append("]]></column-value></column>");
1289 sb.append(
1290 "<column><column-name>status</column-name><column-value><![CDATA[");
1291 sb.append(getStatus());
1292 sb.append("]]></column-value></column>");
1293 sb.append(
1294 "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1295 sb.append(getStatusByUserId());
1296 sb.append("]]></column-value></column>");
1297 sb.append(
1298 "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1299 sb.append(getStatusByUserName());
1300 sb.append("]]></column-value></column>");
1301 sb.append(
1302 "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1303 sb.append(getStatusDate());
1304 sb.append("]]></column-value></column>");
1305
1306 sb.append("</model>");
1307
1308 return sb.toString();
1309 }
1310
1311 private static final ClassLoader _classLoader = DLFileShortcut.class.getClassLoader();
1312 private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1313 DLFileShortcut.class
1314 };
1315 private String _uuid;
1316 private String _originalUuid;
1317 private long _fileShortcutId;
1318 private long _groupId;
1319 private long _originalGroupId;
1320 private boolean _setOriginalGroupId;
1321 private long _companyId;
1322 private long _originalCompanyId;
1323 private boolean _setOriginalCompanyId;
1324 private long _userId;
1325 private String _userName;
1326 private Date _createDate;
1327 private Date _modifiedDate;
1328 private boolean _setModifiedDate;
1329 private long _repositoryId;
1330 private long _folderId;
1331 private long _originalFolderId;
1332 private boolean _setOriginalFolderId;
1333 private long _toFileEntryId;
1334 private long _originalToFileEntryId;
1335 private boolean _setOriginalToFileEntryId;
1336 private String _treePath;
1337 private boolean _active;
1338 private boolean _originalActive;
1339 private boolean _setOriginalActive;
1340 private Date _lastPublishDate;
1341 private int _status;
1342 private int _originalStatus;
1343 private boolean _setOriginalStatus;
1344 private long _statusByUserId;
1345 private String _statusByUserName;
1346 private Date _statusDate;
1347 private long _columnBitmask;
1348 private DLFileShortcut _escapedModel;
1349 }