001
014
015 package com.liferay.portlet.documentlibrary.model.impl;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.repository.model.FileEntry;
020 import com.liferay.portal.kernel.repository.model.Folder;
021 import com.liferay.portal.repository.liferayrepository.model.LiferayFolder;
022 import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
023
024
027 public class DLFileShortcutImpl extends DLFileShortcutBaseImpl {
028
029 public DLFileShortcutImpl() {
030 }
031
032 @Override
033 public Folder getFolder() {
034 Folder folder = null;
035
036 if (getFolderId() > 0) {
037 try {
038 folder = DLAppLocalServiceUtil.getFolder(getFolderId());
039 }
040 catch (Exception e) {
041 folder = new LiferayFolder(new DLFolderImpl());
042
043 _log.error(e);
044 }
045 }
046 else {
047 folder = new LiferayFolder(new DLFolderImpl());
048 }
049
050 return folder;
051 }
052
053 @Override
054 public String getToTitle() {
055 String toTitle = null;
056
057 try {
058 FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(
059 getToFileEntryId());
060
061 toTitle = fileEntry.getTitle();
062 }
063 catch (Exception e) {
064 _log.error(e);
065 }
066
067 return toTitle;
068 }
069
070 private static Log _log = LogFactoryUtil.getLog(DLFileShortcutImpl.class);
071
072 }