001
014
015 package com.liferay.document.library.kernel.service;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.document.library.kernel.model.DLFileEntry;
020 import com.liferay.document.library.kernel.model.DLFileVersion;
021
022 import com.liferay.dynamic.data.mapping.kernel.DDMFormValues;
023
024 import com.liferay.portal.kernel.exception.PortalException;
025 import com.liferay.portal.kernel.exception.SystemException;
026 import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
027 import com.liferay.portal.kernel.lock.Lock;
028 import com.liferay.portal.kernel.search.Hits;
029 import com.liferay.portal.kernel.security.access.control.AccessControlled;
030 import com.liferay.portal.kernel.service.BaseService;
031 import com.liferay.portal.kernel.service.ServiceContext;
032 import com.liferay.portal.kernel.transaction.Isolation;
033 import com.liferay.portal.kernel.transaction.Propagation;
034 import com.liferay.portal.kernel.transaction.Transactional;
035 import com.liferay.portal.kernel.util.OrderByComparator;
036
037 import java.io.File;
038 import java.io.InputStream;
039 import java.io.Serializable;
040
041 import java.util.List;
042 import java.util.Map;
043
044
055 @AccessControlled
056 @JSONWebService
057 @ProviderType
058 @Transactional(isolation = Isolation.PORTAL, rollbackFor = {
059 PortalException.class, SystemException.class})
060 public interface DLFileEntryService extends BaseService {
061
066 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
067 public boolean hasFileEntryLock(long fileEntryId) throws PortalException;
068
069 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
070 public boolean isFileEntryCheckedOut(long fileEntryId)
071 throws PortalException;
072
073 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
074 public boolean isKeepFileVersionLabel(long fileEntryId,
075 boolean majorVersion, ServiceContext serviceContext)
076 throws PortalException;
077
078
082 @java.lang.Deprecated
083 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
084 public boolean isKeepFileVersionLabel(long fileEntryId,
085 ServiceContext serviceContext) throws PortalException;
086
087 public boolean verifyFileEntryCheckOut(long fileEntryId,
088 java.lang.String lockUuid) throws PortalException;
089
090 public boolean verifyFileEntryLock(long fileEntryId,
091 java.lang.String lockUuid) throws PortalException;
092
093 public DLFileEntry addFileEntry(long groupId, long repositoryId,
094 long folderId, java.lang.String sourceFileName,
095 java.lang.String mimeType, java.lang.String title,
096 java.lang.String description, java.lang.String changeLog,
097 long fileEntryTypeId,
098 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
099 InputStream is, long size, ServiceContext serviceContext)
100 throws PortalException;
101
102 public DLFileEntry checkOutFileEntry(long fileEntryId,
103 ServiceContext serviceContext) throws PortalException;
104
105 public DLFileEntry checkOutFileEntry(long fileEntryId,
106 java.lang.String owner, long expirationTime,
107 ServiceContext serviceContext) throws PortalException;
108
109 public DLFileEntry copyFileEntry(long groupId, long repositoryId,
110 long fileEntryId, long destFolderId, ServiceContext serviceContext)
111 throws PortalException;
112
113 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
114 public DLFileEntry fetchFileEntryByImageId(long imageId)
115 throws PortalException;
116
117 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
118 public DLFileEntry getFileEntry(long fileEntryId) throws PortalException;
119
120 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
121 public DLFileEntry getFileEntry(long groupId, long folderId,
122 java.lang.String title) throws PortalException;
123
124 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125 public DLFileEntry getFileEntryByUuidAndGroupId(java.lang.String uuid,
126 long groupId) throws PortalException;
127
128 public DLFileEntry moveFileEntry(long fileEntryId, long newFolderId,
129 ServiceContext serviceContext) throws PortalException;
130
131 public DLFileEntry updateFileEntry(long fileEntryId,
132 java.lang.String sourceFileName, java.lang.String mimeType,
133 java.lang.String title, java.lang.String description,
134 java.lang.String changeLog, boolean majorVersion, long fileEntryTypeId,
135 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
136 InputStream is, long size, ServiceContext serviceContext)
137 throws PortalException;
138
139 public DLFileEntry updateStatus(long userId, long fileVersionId,
140 int status, ServiceContext serviceContext,
141 Map<java.lang.String, Serializable> workflowContext)
142 throws PortalException;
143
144 public DLFileVersion cancelCheckOut(long fileEntryId)
145 throws PortalException;
146
147 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148 public Lock getFileEntryLock(long fileEntryId);
149
150 public Lock refreshFileEntryLock(java.lang.String lockUuid, long companyId,
151 long expirationTime) throws PortalException;
152
153 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
154 public Hits search(long groupId, long creatorUserId, int status, int start,
155 int end) throws PortalException;
156
157 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
158 public Hits search(long groupId, long creatorUserId, long folderId,
159 java.lang.String[] mimeTypes, int status, int start, int end)
160 throws PortalException;
161
162 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
163 public int getFileEntriesCount(long groupId, long folderId);
164
165 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
166 public int getFileEntriesCount(long groupId, long folderId, int status);
167
168 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
169 public int getFileEntriesCount(long groupId, long folderId,
170 java.lang.String[] mimeTypes);
171
172 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
173 public int getFileEntriesCount(long groupId, long folderId,
174 long fileEntryTypeId);
175
176 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
177 public int getFoldersFileEntriesCount(long groupId,
178 List<java.lang.Long> folderIds, int status);
179
180 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181 public int getGroupFileEntriesCount(long groupId, long userId,
182 long repositoryId, long rootFolderId, java.lang.String[] mimeTypes,
183 int status) throws PortalException;
184
185 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186 public int getGroupFileEntriesCount(long groupId, long userId,
187 long rootFolderId) throws PortalException;
188
189 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190 public int getGroupFileEntriesCount(long groupId, long userId,
191 long rootFolderId, java.lang.String[] mimeTypes, int status)
192 throws PortalException;
193
194 public InputStream getFileAsStream(long fileEntryId,
195 java.lang.String version) throws PortalException;
196
197 public InputStream getFileAsStream(long fileEntryId,
198 java.lang.String version, boolean incrementCounter)
199 throws PortalException;
200
201
206 public java.lang.String getOSGiServiceIdentifier();
207
208 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
210 int start, int end, OrderByComparator<DLFileEntry> obc)
211 throws PortalException;
212
213 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
214 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
215 int status, int start, int end, OrderByComparator<DLFileEntry> obc)
216 throws PortalException;
217
218 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
219 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
220 java.lang.String[] mimeTypes, int start, int end,
221 OrderByComparator<DLFileEntry> obc) throws PortalException;
222
223 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
224 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
225 long fileEntryTypeId, int start, int end,
226 OrderByComparator<DLFileEntry> obc) throws PortalException;
227
228 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
229 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
230 long repositoryId, long rootFolderId, java.lang.String[] mimeTypes,
231 int status, int start, int end, OrderByComparator<DLFileEntry> obc)
232 throws PortalException;
233
234 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
236 long rootFolderId, int start, int end,
237 OrderByComparator<DLFileEntry> obc) throws PortalException;
238
239 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
240 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
241 long rootFolderId, java.lang.String[] mimeTypes, int status, int start,
242 int end, OrderByComparator<DLFileEntry> obc) throws PortalException;
243
244 public void checkInFileEntry(long fileEntryId, boolean major,
245 java.lang.String changeLog, ServiceContext serviceContext)
246 throws PortalException;
247
248 public void checkInFileEntry(long fileEntryId, java.lang.String lockUuid,
249 ServiceContext serviceContext) throws PortalException;
250
251 public void deleteFileEntry(long fileEntryId) throws PortalException;
252
253 public void deleteFileEntry(long groupId, long folderId,
254 java.lang.String title) throws PortalException;
255
256 public void deleteFileVersion(long fileEntryId, java.lang.String version)
257 throws PortalException;
258
259 public void revertFileEntry(long fileEntryId, java.lang.String version,
260 ServiceContext serviceContext) throws PortalException;
261 }