001
014
015 package com.liferay.portlet.documentlibrary.model;
016
017 import com.liferay.portal.kernel.lar.StagedModelType;
018 import com.liferay.portal.kernel.util.Validator;
019 import com.liferay.portal.model.ModelWrapper;
020
021 import java.util.Date;
022 import java.util.HashMap;
023 import java.util.Map;
024
025
034 public class DLFileEntryWrapper implements DLFileEntry,
035 ModelWrapper<DLFileEntry> {
036 public DLFileEntryWrapper(DLFileEntry dlFileEntry) {
037 _dlFileEntry = dlFileEntry;
038 }
039
040 @Override
041 public Class<?> getModelClass() {
042 return DLFileEntry.class;
043 }
044
045 @Override
046 public String getModelClassName() {
047 return DLFileEntry.class.getName();
048 }
049
050 @Override
051 public Map<String, Object> getModelAttributes() {
052 Map<String, Object> attributes = new HashMap<String, Object>();
053
054 attributes.put("uuid", getUuid());
055 attributes.put("fileEntryId", getFileEntryId());
056 attributes.put("groupId", getGroupId());
057 attributes.put("companyId", getCompanyId());
058 attributes.put("userId", getUserId());
059 attributes.put("userName", getUserName());
060 attributes.put("createDate", getCreateDate());
061 attributes.put("modifiedDate", getModifiedDate());
062 attributes.put("classNameId", getClassNameId());
063 attributes.put("classPK", getClassPK());
064 attributes.put("repositoryId", getRepositoryId());
065 attributes.put("folderId", getFolderId());
066 attributes.put("name", getName());
067 attributes.put("extension", getExtension());
068 attributes.put("mimeType", getMimeType());
069 attributes.put("title", getTitle());
070 attributes.put("description", getDescription());
071 attributes.put("extraSettings", getExtraSettings());
072 attributes.put("fileEntryTypeId", getFileEntryTypeId());
073 attributes.put("version", getVersion());
074 attributes.put("size", getSize());
075 attributes.put("readCount", getReadCount());
076 attributes.put("smallImageId", getSmallImageId());
077 attributes.put("largeImageId", getLargeImageId());
078 attributes.put("custom1ImageId", getCustom1ImageId());
079 attributes.put("custom2ImageId", getCustom2ImageId());
080 attributes.put("manualCheckInRequired", getManualCheckInRequired());
081
082 return attributes;
083 }
084
085 @Override
086 public void setModelAttributes(Map<String, Object> attributes) {
087 String uuid = (String)attributes.get("uuid");
088
089 if (uuid != null) {
090 setUuid(uuid);
091 }
092
093 Long fileEntryId = (Long)attributes.get("fileEntryId");
094
095 if (fileEntryId != null) {
096 setFileEntryId(fileEntryId);
097 }
098
099 Long groupId = (Long)attributes.get("groupId");
100
101 if (groupId != null) {
102 setGroupId(groupId);
103 }
104
105 Long companyId = (Long)attributes.get("companyId");
106
107 if (companyId != null) {
108 setCompanyId(companyId);
109 }
110
111 Long userId = (Long)attributes.get("userId");
112
113 if (userId != null) {
114 setUserId(userId);
115 }
116
117 String userName = (String)attributes.get("userName");
118
119 if (userName != null) {
120 setUserName(userName);
121 }
122
123 Date createDate = (Date)attributes.get("createDate");
124
125 if (createDate != null) {
126 setCreateDate(createDate);
127 }
128
129 Date modifiedDate = (Date)attributes.get("modifiedDate");
130
131 if (modifiedDate != null) {
132 setModifiedDate(modifiedDate);
133 }
134
135 Long classNameId = (Long)attributes.get("classNameId");
136
137 if (classNameId != null) {
138 setClassNameId(classNameId);
139 }
140
141 Long classPK = (Long)attributes.get("classPK");
142
143 if (classPK != null) {
144 setClassPK(classPK);
145 }
146
147 Long repositoryId = (Long)attributes.get("repositoryId");
148
149 if (repositoryId != null) {
150 setRepositoryId(repositoryId);
151 }
152
153 Long folderId = (Long)attributes.get("folderId");
154
155 if (folderId != null) {
156 setFolderId(folderId);
157 }
158
159 String name = (String)attributes.get("name");
160
161 if (name != null) {
162 setName(name);
163 }
164
165 String extension = (String)attributes.get("extension");
166
167 if (extension != null) {
168 setExtension(extension);
169 }
170
171 String mimeType = (String)attributes.get("mimeType");
172
173 if (mimeType != null) {
174 setMimeType(mimeType);
175 }
176
177 String title = (String)attributes.get("title");
178
179 if (title != null) {
180 setTitle(title);
181 }
182
183 String description = (String)attributes.get("description");
184
185 if (description != null) {
186 setDescription(description);
187 }
188
189 String extraSettings = (String)attributes.get("extraSettings");
190
191 if (extraSettings != null) {
192 setExtraSettings(extraSettings);
193 }
194
195 Long fileEntryTypeId = (Long)attributes.get("fileEntryTypeId");
196
197 if (fileEntryTypeId != null) {
198 setFileEntryTypeId(fileEntryTypeId);
199 }
200
201 String version = (String)attributes.get("version");
202
203 if (version != null) {
204 setVersion(version);
205 }
206
207 Long size = (Long)attributes.get("size");
208
209 if (size != null) {
210 setSize(size);
211 }
212
213 Integer readCount = (Integer)attributes.get("readCount");
214
215 if (readCount != null) {
216 setReadCount(readCount);
217 }
218
219 Long smallImageId = (Long)attributes.get("smallImageId");
220
221 if (smallImageId != null) {
222 setSmallImageId(smallImageId);
223 }
224
225 Long largeImageId = (Long)attributes.get("largeImageId");
226
227 if (largeImageId != null) {
228 setLargeImageId(largeImageId);
229 }
230
231 Long custom1ImageId = (Long)attributes.get("custom1ImageId");
232
233 if (custom1ImageId != null) {
234 setCustom1ImageId(custom1ImageId);
235 }
236
237 Long custom2ImageId = (Long)attributes.get("custom2ImageId");
238
239 if (custom2ImageId != null) {
240 setCustom2ImageId(custom2ImageId);
241 }
242
243 Boolean manualCheckInRequired = (Boolean)attributes.get(
244 "manualCheckInRequired");
245
246 if (manualCheckInRequired != null) {
247 setManualCheckInRequired(manualCheckInRequired);
248 }
249 }
250
251
256 @Override
257 public long getPrimaryKey() {
258 return _dlFileEntry.getPrimaryKey();
259 }
260
261
266 @Override
267 public void setPrimaryKey(long primaryKey) {
268 _dlFileEntry.setPrimaryKey(primaryKey);
269 }
270
271
276 @Override
277 public java.lang.String getUuid() {
278 return _dlFileEntry.getUuid();
279 }
280
281
286 @Override
287 public void setUuid(java.lang.String uuid) {
288 _dlFileEntry.setUuid(uuid);
289 }
290
291
296 @Override
297 public long getFileEntryId() {
298 return _dlFileEntry.getFileEntryId();
299 }
300
301
306 @Override
307 public void setFileEntryId(long fileEntryId) {
308 _dlFileEntry.setFileEntryId(fileEntryId);
309 }
310
311
316 @Override
317 public long getGroupId() {
318 return _dlFileEntry.getGroupId();
319 }
320
321
326 @Override
327 public void setGroupId(long groupId) {
328 _dlFileEntry.setGroupId(groupId);
329 }
330
331
336 @Override
337 public long getCompanyId() {
338 return _dlFileEntry.getCompanyId();
339 }
340
341
346 @Override
347 public void setCompanyId(long companyId) {
348 _dlFileEntry.setCompanyId(companyId);
349 }
350
351
356 @Override
357 public long getUserId() {
358 return _dlFileEntry.getUserId();
359 }
360
361
366 @Override
367 public void setUserId(long userId) {
368 _dlFileEntry.setUserId(userId);
369 }
370
371
377 @Override
378 public java.lang.String getUserUuid()
379 throws com.liferay.portal.kernel.exception.SystemException {
380 return _dlFileEntry.getUserUuid();
381 }
382
383
388 @Override
389 public void setUserUuid(java.lang.String userUuid) {
390 _dlFileEntry.setUserUuid(userUuid);
391 }
392
393
398 @Override
399 public java.lang.String getUserName() {
400 return _dlFileEntry.getUserName();
401 }
402
403
408 @Override
409 public void setUserName(java.lang.String userName) {
410 _dlFileEntry.setUserName(userName);
411 }
412
413
418 @Override
419 public java.util.Date getCreateDate() {
420 return _dlFileEntry.getCreateDate();
421 }
422
423
428 @Override
429 public void setCreateDate(java.util.Date createDate) {
430 _dlFileEntry.setCreateDate(createDate);
431 }
432
433
438 @Override
439 public java.util.Date getModifiedDate() {
440 return _dlFileEntry.getModifiedDate();
441 }
442
443
448 @Override
449 public void setModifiedDate(java.util.Date modifiedDate) {
450 _dlFileEntry.setModifiedDate(modifiedDate);
451 }
452
453
458 @Override
459 public java.lang.String getClassName() {
460 return _dlFileEntry.getClassName();
461 }
462
463 @Override
464 public void setClassName(java.lang.String className) {
465 _dlFileEntry.setClassName(className);
466 }
467
468
473 @Override
474 public long getClassNameId() {
475 return _dlFileEntry.getClassNameId();
476 }
477
478
483 @Override
484 public void setClassNameId(long classNameId) {
485 _dlFileEntry.setClassNameId(classNameId);
486 }
487
488
493 @Override
494 public long getClassPK() {
495 return _dlFileEntry.getClassPK();
496 }
497
498
503 @Override
504 public void setClassPK(long classPK) {
505 _dlFileEntry.setClassPK(classPK);
506 }
507
508
513 @Override
514 public long getRepositoryId() {
515 return _dlFileEntry.getRepositoryId();
516 }
517
518
523 @Override
524 public void setRepositoryId(long repositoryId) {
525 _dlFileEntry.setRepositoryId(repositoryId);
526 }
527
528
533 @Override
534 public long getFolderId() {
535 return _dlFileEntry.getFolderId();
536 }
537
538
543 @Override
544 public void setFolderId(long folderId) {
545 _dlFileEntry.setFolderId(folderId);
546 }
547
548
553 @Override
554 public java.lang.String getName() {
555 return _dlFileEntry.getName();
556 }
557
558
563 @Override
564 public void setName(java.lang.String name) {
565 _dlFileEntry.setName(name);
566 }
567
568
573 @Override
574 public java.lang.String getExtension() {
575 return _dlFileEntry.getExtension();
576 }
577
578
583 @Override
584 public void setExtension(java.lang.String extension) {
585 _dlFileEntry.setExtension(extension);
586 }
587
588
593 @Override
594 public java.lang.String getMimeType() {
595 return _dlFileEntry.getMimeType();
596 }
597
598
603 @Override
604 public void setMimeType(java.lang.String mimeType) {
605 _dlFileEntry.setMimeType(mimeType);
606 }
607
608
613 @Override
614 public java.lang.String getTitle() {
615 return _dlFileEntry.getTitle();
616 }
617
618
623 @Override
624 public void setTitle(java.lang.String title) {
625 _dlFileEntry.setTitle(title);
626 }
627
628
633 @Override
634 public java.lang.String getDescription() {
635 return _dlFileEntry.getDescription();
636 }
637
638
643 @Override
644 public void setDescription(java.lang.String description) {
645 _dlFileEntry.setDescription(description);
646 }
647
648
653 @Override
654 public java.lang.String getExtraSettings() {
655 return _dlFileEntry.getExtraSettings();
656 }
657
658
663 @Override
664 public void setExtraSettings(java.lang.String extraSettings) {
665 _dlFileEntry.setExtraSettings(extraSettings);
666 }
667
668
673 @Override
674 public long getFileEntryTypeId() {
675 return _dlFileEntry.getFileEntryTypeId();
676 }
677
678
683 @Override
684 public void setFileEntryTypeId(long fileEntryTypeId) {
685 _dlFileEntry.setFileEntryTypeId(fileEntryTypeId);
686 }
687
688
693 @Override
694 public java.lang.String getVersion() {
695 return _dlFileEntry.getVersion();
696 }
697
698
703 @Override
704 public void setVersion(java.lang.String version) {
705 _dlFileEntry.setVersion(version);
706 }
707
708
713 @Override
714 public long getSize() {
715 return _dlFileEntry.getSize();
716 }
717
718
723 @Override
724 public void setSize(long size) {
725 _dlFileEntry.setSize(size);
726 }
727
728
733 @Override
734 public int getReadCount() {
735 return _dlFileEntry.getReadCount();
736 }
737
738
743 @Override
744 public void setReadCount(int readCount) {
745 _dlFileEntry.setReadCount(readCount);
746 }
747
748
753 @Override
754 public long getSmallImageId() {
755 return _dlFileEntry.getSmallImageId();
756 }
757
758
763 @Override
764 public void setSmallImageId(long smallImageId) {
765 _dlFileEntry.setSmallImageId(smallImageId);
766 }
767
768
773 @Override
774 public long getLargeImageId() {
775 return _dlFileEntry.getLargeImageId();
776 }
777
778
783 @Override
784 public void setLargeImageId(long largeImageId) {
785 _dlFileEntry.setLargeImageId(largeImageId);
786 }
787
788
793 @Override
794 public long getCustom1ImageId() {
795 return _dlFileEntry.getCustom1ImageId();
796 }
797
798
803 @Override
804 public void setCustom1ImageId(long custom1ImageId) {
805 _dlFileEntry.setCustom1ImageId(custom1ImageId);
806 }
807
808
813 @Override
814 public long getCustom2ImageId() {
815 return _dlFileEntry.getCustom2ImageId();
816 }
817
818
823 @Override
824 public void setCustom2ImageId(long custom2ImageId) {
825 _dlFileEntry.setCustom2ImageId(custom2ImageId);
826 }
827
828
833 @Override
834 public boolean getManualCheckInRequired() {
835 return _dlFileEntry.getManualCheckInRequired();
836 }
837
838
843 @Override
844 public boolean isManualCheckInRequired() {
845 return _dlFileEntry.isManualCheckInRequired();
846 }
847
848
853 @Override
854 public void setManualCheckInRequired(boolean manualCheckInRequired) {
855 _dlFileEntry.setManualCheckInRequired(manualCheckInRequired);
856 }
857
858 @Override
859 public boolean isNew() {
860 return _dlFileEntry.isNew();
861 }
862
863 @Override
864 public void setNew(boolean n) {
865 _dlFileEntry.setNew(n);
866 }
867
868 @Override
869 public boolean isCachedModel() {
870 return _dlFileEntry.isCachedModel();
871 }
872
873 @Override
874 public void setCachedModel(boolean cachedModel) {
875 _dlFileEntry.setCachedModel(cachedModel);
876 }
877
878 @Override
879 public boolean isEscapedModel() {
880 return _dlFileEntry.isEscapedModel();
881 }
882
883 @Override
884 public java.io.Serializable getPrimaryKeyObj() {
885 return _dlFileEntry.getPrimaryKeyObj();
886 }
887
888 @Override
889 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
890 _dlFileEntry.setPrimaryKeyObj(primaryKeyObj);
891 }
892
893 @Override
894 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
895 return _dlFileEntry.getExpandoBridge();
896 }
897
898 @Override
899 public void setExpandoBridgeAttributes(
900 com.liferay.portal.model.BaseModel<?> baseModel) {
901 _dlFileEntry.setExpandoBridgeAttributes(baseModel);
902 }
903
904 @Override
905 public void setExpandoBridgeAttributes(
906 com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
907 _dlFileEntry.setExpandoBridgeAttributes(expandoBridge);
908 }
909
910 @Override
911 public void setExpandoBridgeAttributes(
912 com.liferay.portal.service.ServiceContext serviceContext) {
913 _dlFileEntry.setExpandoBridgeAttributes(serviceContext);
914 }
915
916 @Override
917 public java.lang.Object clone() {
918 return new DLFileEntryWrapper((DLFileEntry)_dlFileEntry.clone());
919 }
920
921 @Override
922 public int compareTo(
923 com.liferay.portlet.documentlibrary.model.DLFileEntry dlFileEntry) {
924 return _dlFileEntry.compareTo(dlFileEntry);
925 }
926
927 @Override
928 public int hashCode() {
929 return _dlFileEntry.hashCode();
930 }
931
932 @Override
933 public com.liferay.portal.model.CacheModel<com.liferay.portlet.documentlibrary.model.DLFileEntry> toCacheModel() {
934 return _dlFileEntry.toCacheModel();
935 }
936
937 @Override
938 public com.liferay.portlet.documentlibrary.model.DLFileEntry toEscapedModel() {
939 return new DLFileEntryWrapper(_dlFileEntry.toEscapedModel());
940 }
941
942 @Override
943 public com.liferay.portlet.documentlibrary.model.DLFileEntry toUnescapedModel() {
944 return new DLFileEntryWrapper(_dlFileEntry.toUnescapedModel());
945 }
946
947 @Override
948 public java.lang.String toString() {
949 return _dlFileEntry.toString();
950 }
951
952 @Override
953 public java.lang.String toXmlString() {
954 return _dlFileEntry.toXmlString();
955 }
956
957 @Override
958 public void persist()
959 throws com.liferay.portal.kernel.exception.SystemException {
960 _dlFileEntry.persist();
961 }
962
963 @Override
964 public java.io.InputStream getContentStream()
965 throws com.liferay.portal.kernel.exception.PortalException,
966 com.liferay.portal.kernel.exception.SystemException {
967 return _dlFileEntry.getContentStream();
968 }
969
970 @Override
971 public java.io.InputStream getContentStream(java.lang.String version)
972 throws com.liferay.portal.kernel.exception.PortalException,
973 com.liferay.portal.kernel.exception.SystemException {
974 return _dlFileEntry.getContentStream(version);
975 }
976
977 @Override
978 public long getDataRepositoryId() {
979 return _dlFileEntry.getDataRepositoryId();
980 }
981
982 @Override
983 public com.liferay.portal.kernel.util.UnicodeProperties getExtraSettingsProperties() {
984 return _dlFileEntry.getExtraSettingsProperties();
985 }
986
987 @Override
988 public java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> getFieldsMap(
989 long fileVersionId)
990 throws com.liferay.portal.kernel.exception.PortalException,
991 com.liferay.portal.kernel.exception.SystemException {
992 return _dlFileEntry.getFieldsMap(fileVersionId);
993 }
994
995 @Override
996 public com.liferay.portlet.documentlibrary.model.DLFileVersion getFileVersion()
997 throws com.liferay.portal.kernel.exception.PortalException,
998 com.liferay.portal.kernel.exception.SystemException {
999 return _dlFileEntry.getFileVersion();
1000 }
1001
1002 @Override
1003 public com.liferay.portlet.documentlibrary.model.DLFileVersion getFileVersion(
1004 java.lang.String version)
1005 throws com.liferay.portal.kernel.exception.PortalException,
1006 com.liferay.portal.kernel.exception.SystemException {
1007 return _dlFileEntry.getFileVersion(version);
1008 }
1009
1010 @Override
1011 public java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> getFileVersions(
1012 int status) throws com.liferay.portal.kernel.exception.SystemException {
1013 return _dlFileEntry.getFileVersions(status);
1014 }
1015
1016 @Override
1017 public int getFileVersionsCount(int status)
1018 throws com.liferay.portal.kernel.exception.SystemException {
1019 return _dlFileEntry.getFileVersionsCount(status);
1020 }
1021
1022 @Override
1023 public com.liferay.portlet.documentlibrary.model.DLFolder getFolder()
1024 throws com.liferay.portal.kernel.exception.PortalException,
1025 com.liferay.portal.kernel.exception.SystemException {
1026 return _dlFileEntry.getFolder();
1027 }
1028
1029 @Override
1030 public java.lang.String getIcon() {
1031 return _dlFileEntry.getIcon();
1032 }
1033
1034 @Override
1035 public com.liferay.portlet.documentlibrary.model.DLFileVersion getLatestFileVersion(
1036 boolean trusted)
1037 throws com.liferay.portal.kernel.exception.PortalException,
1038 com.liferay.portal.kernel.exception.SystemException {
1039 return _dlFileEntry.getLatestFileVersion(trusted);
1040 }
1041
1042 @Override
1043 public com.liferay.portal.model.Lock getLock() {
1044 return _dlFileEntry.getLock();
1045 }
1046
1047 @Override
1048 public java.lang.String getLuceneProperties() {
1049 return _dlFileEntry.getLuceneProperties();
1050 }
1051
1052 @Override
1053 public com.liferay.portlet.documentlibrary.model.DLFolder getTrashContainer()
1054 throws com.liferay.portal.kernel.exception.PortalException,
1055 com.liferay.portal.kernel.exception.SystemException {
1056 return _dlFileEntry.getTrashContainer();
1057 }
1058
1059
1062 @Override
1063 public long getVersionUserId() {
1064 return _dlFileEntry.getVersionUserId();
1065 }
1066
1067
1070 @Override
1071 public java.lang.String getVersionUserName() {
1072 return _dlFileEntry.getVersionUserName();
1073 }
1074
1075
1078 @Override
1079 public java.lang.String getVersionUserUuid() {
1080 return _dlFileEntry.getVersionUserUuid();
1081 }
1082
1083 @Override
1084 public boolean hasLock() {
1085 return _dlFileEntry.hasLock();
1086 }
1087
1088 @Override
1089 public boolean isCheckedOut() {
1090 return _dlFileEntry.isCheckedOut();
1091 }
1092
1093 @Override
1094 public boolean isInHiddenFolder() {
1095 return _dlFileEntry.isInHiddenFolder();
1096 }
1097
1098 @Override
1099 public boolean isInTrashContainer()
1100 throws com.liferay.portal.kernel.exception.PortalException,
1101 com.liferay.portal.kernel.exception.SystemException {
1102 return _dlFileEntry.isInTrashContainer();
1103 }
1104
1105 @Override
1106 public void setExtraSettingsProperties(
1107 com.liferay.portal.kernel.util.UnicodeProperties extraSettingsProperties) {
1108 _dlFileEntry.setExtraSettingsProperties(extraSettingsProperties);
1109 }
1110
1111 @Override
1112 public boolean equals(Object obj) {
1113 if (this == obj) {
1114 return true;
1115 }
1116
1117 if (!(obj instanceof DLFileEntryWrapper)) {
1118 return false;
1119 }
1120
1121 DLFileEntryWrapper dlFileEntryWrapper = (DLFileEntryWrapper)obj;
1122
1123 if (Validator.equals(_dlFileEntry, dlFileEntryWrapper._dlFileEntry)) {
1124 return true;
1125 }
1126
1127 return false;
1128 }
1129
1130 @Override
1131 public StagedModelType getStagedModelType() {
1132 return _dlFileEntry.getStagedModelType();
1133 }
1134
1135
1138 public DLFileEntry getWrappedDLFileEntry() {
1139 return _dlFileEntry;
1140 }
1141
1142 @Override
1143 public DLFileEntry getWrappedModel() {
1144 return _dlFileEntry;
1145 }
1146
1147 @Override
1148 public void resetOriginalValues() {
1149 _dlFileEntry.resetOriginalValues();
1150 }
1151
1152 private DLFileEntry _dlFileEntry;
1153 }