001
014
015 package com.liferay.portal.kernel.repository;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.repository.capabilities.CapabilityProvider;
019 import com.liferay.portal.kernel.repository.model.FileEntry;
020 import com.liferay.portal.kernel.repository.model.FileShortcut;
021 import com.liferay.portal.kernel.repository.model.FileVersion;
022 import com.liferay.portal.kernel.repository.model.Folder;
023 import com.liferay.portal.kernel.repository.model.RepositoryEntry;
024 import com.liferay.portal.kernel.service.ServiceContext;
025 import com.liferay.portal.kernel.util.OrderByComparator;
026
027 import java.io.File;
028 import java.io.InputStream;
029
030 import java.util.List;
031
032
035 public interface DocumentRepository extends CapabilityProvider {
036
037 public FileEntry addFileEntry(
038 long userId, long folderId, String sourceFileName, String mimeType,
039 String title, String description, String changeLog, File file,
040 ServiceContext serviceContext)
041 throws PortalException;
042
043 public FileEntry addFileEntry(
044 long userId, long folderId, String sourceFileName, String mimeType,
045 String title, String description, String changeLog, InputStream is,
046 long size, ServiceContext serviceContext)
047 throws PortalException;
048
049 public FileShortcut addFileShortcut(
050 long userId, long folderId, long toFileEntryId,
051 ServiceContext serviceContext)
052 throws PortalException;
053
054 public Folder addFolder(
055 long userId, long parentFolderId, String name, String description,
056 ServiceContext serviceContext)
057 throws PortalException;
058
059 public void checkInFileEntry(
060 long userId, long fileEntryId, boolean majorVersion,
061 String changeLog, ServiceContext serviceContext)
062 throws PortalException;
063
064 public void checkInFileEntry(
065 long userId, long fileEntryId, String lockUuid,
066 ServiceContext serviceContext)
067 throws PortalException;
068
069 public FileEntry copyFileEntry(
070 long userId, long groupId, long fileEntryId, long destFolderId,
071 ServiceContext serviceContext)
072 throws PortalException;
073
074 public void deleteAll() throws PortalException;
075
076 public void deleteFileEntry(long fileEntryId) throws PortalException;
077
078 public void deleteFileShortcut(long fileShortcutId) throws PortalException;
079
080 public void deleteFileShortcuts(long toFileEntryId) throws PortalException;
081
082 public void deleteFolder(long folderId) throws PortalException;
083
084 public List<FileEntry> getFileEntries(
085 long folderId, int status, int start, int end,
086 OrderByComparator<FileEntry> obc)
087 throws PortalException;
088
089 public List<FileEntry> getFileEntries(
090 long folderId, int start, int end, OrderByComparator<FileEntry> obc)
091 throws PortalException;
092
093 public List<RepositoryEntry> getFileEntriesAndFileShortcuts(
094 long folderId, int status, int start, int end)
095 throws PortalException;
096
097 public int getFileEntriesAndFileShortcutsCount(long folderId, int status)
098 throws PortalException;
099
100 public int getFileEntriesCount(long folderId) throws PortalException;
101
102 public int getFileEntriesCount(long folderId, int status)
103 throws PortalException;
104
105 public FileEntry getFileEntry(long fileEntryId) throws PortalException;
106
107 public FileEntry getFileEntry(long folderId, String title)
108 throws PortalException;
109
110 public FileEntry getFileEntryByUuid(String uuid) throws PortalException;
111
112 public FileShortcut getFileShortcut(long fileShortcutId)
113 throws PortalException;
114
115 public FileVersion getFileVersion(long fileVersionId)
116 throws PortalException;
117
118 public Folder getFolder(long folderId) throws PortalException;
119
120 public Folder getFolder(long parentFolderId, String name)
121 throws PortalException;
122
123 public List<Folder> getFolders(
124 long parentFolderId, boolean includeMountFolders, int start,
125 int end, OrderByComparator<Folder> obc)
126 throws PortalException;
127
128 public List<Folder> getFolders(
129 long parentFolderId, int status, boolean includeMountFolders,
130 int start, int end, OrderByComparator<Folder> obc)
131 throws PortalException;
132
133 public List<RepositoryEntry> getFoldersAndFileEntriesAndFileShortcuts(
134 long folderId, int status, boolean includeMountFolders, int start,
135 int end, OrderByComparator<?> obc)
136 throws PortalException;
137
138 public int getFoldersAndFileEntriesAndFileShortcutsCount(
139 long folderId, int status, boolean includeMountFolders)
140 throws PortalException;
141
142 public int getFoldersCount(long parentFolderId, boolean includeMountfolders)
143 throws PortalException;
144
145 public int getFoldersCount(
146 long parentFolderId, int status, boolean includeMountfolders)
147 throws PortalException;
148
149 public List<FileEntry> getRepositoryFileEntries(
150 long userId, long rootFolderId, int start, int end,
151 OrderByComparator<FileEntry> obc)
152 throws PortalException;
153
154 public long getRepositoryId();
155
156 public FileEntry moveFileEntry(
157 long userId, long fileEntryId, long newFolderId,
158 ServiceContext serviceContext)
159 throws PortalException;
160
161 public Folder moveFolder(
162 long userId, long folderId, long parentFolderId,
163 ServiceContext serviceContext)
164 throws PortalException;
165
166 public void revertFileEntry(
167 long userId, long fileEntryId, String version,
168 ServiceContext serviceContext)
169 throws PortalException;
170
171 public FileEntry updateFileEntry(
172 long userId, long fileEntryId, String sourceFileName,
173 String mimeType, String title, String description, String changeLog,
174 boolean majorVersion, File file, ServiceContext serviceContext)
175 throws PortalException;
176
177 public FileEntry updateFileEntry(
178 long userId, long fileEntryId, String sourceFileName,
179 String mimeType, String title, String description, String changeLog,
180 boolean majorVersion, InputStream is, long size,
181 ServiceContext serviceContext)
182 throws PortalException;
183
184 public FileShortcut updateFileShortcut(
185 long userId, long fileShortcutId, long folderId, long toFileEntryId,
186 ServiceContext serviceContext)
187 throws PortalException;
188
189 public void updateFileShortcuts(
190 long oldToFileEntryId, long newToFileEntryId)
191 throws PortalException;
192
193 public Folder updateFolder(
194 long folderId, long parentFolderId, String name, String description,
195 ServiceContext serviceContext)
196 throws PortalException;
197
198 }