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 public DLFileEntry addFileEntry(long groupId, long repositoryId,
067 long folderId, java.lang.String sourceFileName,
068 java.lang.String mimeType, java.lang.String title,
069 java.lang.String description, java.lang.String changeLog,
070 long fileEntryTypeId,
071 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
072 InputStream is, long size, ServiceContext serviceContext)
073 throws PortalException;
074
075 public DLFileVersion cancelCheckOut(long fileEntryId)
076 throws PortalException;
077
078 public void checkInFileEntry(long fileEntryId, java.lang.String lockUuid,
079 ServiceContext serviceContext) throws PortalException;
080
081 public void checkInFileEntry(long fileEntryId, boolean major,
082 java.lang.String changeLog, ServiceContext serviceContext)
083 throws PortalException;
084
085 public DLFileEntry checkOutFileEntry(long fileEntryId,
086 java.lang.String owner, long expirationTime,
087 ServiceContext serviceContext) throws PortalException;
088
089 public DLFileEntry checkOutFileEntry(long fileEntryId,
090 ServiceContext serviceContext) throws PortalException;
091
092 public DLFileEntry copyFileEntry(long groupId, long repositoryId,
093 long fileEntryId, long destFolderId, ServiceContext serviceContext)
094 throws PortalException;
095
096 public void deleteFileEntry(long fileEntryId) throws PortalException;
097
098 public void deleteFileEntry(long groupId, long folderId,
099 java.lang.String title) throws PortalException;
100
101 public void deleteFileVersion(long fileEntryId, java.lang.String version)
102 throws PortalException;
103
104 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
105 public DLFileEntry fetchFileEntryByImageId(long imageId)
106 throws PortalException;
107
108 public InputStream getFileAsStream(long fileEntryId,
109 java.lang.String version) throws PortalException;
110
111 public InputStream getFileAsStream(long fileEntryId,
112 java.lang.String version, boolean incrementCounter)
113 throws PortalException;
114
115 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
116 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
117 long fileEntryTypeId, int start, int end,
118 OrderByComparator<DLFileEntry> obc) throws PortalException;
119
120 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
121 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
122 java.lang.String[] mimeTypes, int start, int end,
123 OrderByComparator<DLFileEntry> obc) throws PortalException;
124
125 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
126 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
127 int start, int end, OrderByComparator<DLFileEntry> obc)
128 throws PortalException;
129
130 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
131 public List<DLFileEntry> getFileEntries(long groupId, long folderId,
132 int status, int start, int end, OrderByComparator<DLFileEntry> obc)
133 throws PortalException;
134
135 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
136 public int getFileEntriesCount(long groupId, long folderId);
137
138 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
139 public int getFileEntriesCount(long groupId, long folderId,
140 long fileEntryTypeId);
141
142 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
143 public int getFileEntriesCount(long groupId, long folderId,
144 java.lang.String[] mimeTypes);
145
146 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
147 public int getFileEntriesCount(long groupId, long folderId, int status);
148
149 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
150 public DLFileEntry getFileEntry(long fileEntryId) throws PortalException;
151
152 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
153 public DLFileEntry getFileEntry(long groupId, long folderId,
154 java.lang.String title) throws PortalException;
155
156 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
157 public DLFileEntry getFileEntryByUuidAndGroupId(java.lang.String uuid,
158 long groupId) throws PortalException;
159
160 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
161 public Lock getFileEntryLock(long fileEntryId);
162
163 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
164 public int getFoldersFileEntriesCount(long groupId,
165 List<java.lang.Long> folderIds, int status);
166
167 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
168 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
169 long repositoryId, long rootFolderId, java.lang.String[] mimeTypes,
170 int status, int start, int end, OrderByComparator<DLFileEntry> obc)
171 throws PortalException;
172
173 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
175 long rootFolderId, java.lang.String[] mimeTypes, int status, int start,
176 int end, OrderByComparator<DLFileEntry> obc) throws PortalException;
177
178 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179 public List<DLFileEntry> getGroupFileEntries(long groupId, long userId,
180 long rootFolderId, int start, int end,
181 OrderByComparator<DLFileEntry> obc) throws PortalException;
182
183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184 public int getGroupFileEntriesCount(long groupId, long userId,
185 long repositoryId, long rootFolderId, java.lang.String[] mimeTypes,
186 int status) throws PortalException;
187
188 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
189 public int getGroupFileEntriesCount(long groupId, long userId,
190 long rootFolderId) throws PortalException;
191
192 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
193 public int getGroupFileEntriesCount(long groupId, long userId,
194 long rootFolderId, java.lang.String[] mimeTypes, int status)
195 throws PortalException;
196
197
202 public java.lang.String getOSGiServiceIdentifier();
203
204 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205 public boolean hasFileEntryLock(long fileEntryId) throws PortalException;
206
207 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
208 public boolean isFileEntryCheckedOut(long fileEntryId)
209 throws PortalException;
210
211 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
212 public boolean isKeepFileVersionLabel(long fileEntryId,
213 ServiceContext serviceContext) throws PortalException;
214
215 public DLFileEntry moveFileEntry(long fileEntryId, long newFolderId,
216 ServiceContext serviceContext) throws PortalException;
217
218 public Lock refreshFileEntryLock(java.lang.String lockUuid, long companyId,
219 long expirationTime) throws PortalException;
220
221 public void revertFileEntry(long fileEntryId, java.lang.String version,
222 ServiceContext serviceContext) throws PortalException;
223
224 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225 public Hits search(long groupId, long creatorUserId, long folderId,
226 java.lang.String[] mimeTypes, int status, int start, int end)
227 throws PortalException;
228
229 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
230 public Hits search(long groupId, long creatorUserId, int status, int start,
231 int end) throws PortalException;
232
233 public DLFileEntry updateFileEntry(long fileEntryId,
234 java.lang.String sourceFileName, java.lang.String mimeType,
235 java.lang.String title, java.lang.String description,
236 java.lang.String changeLog, boolean majorVersion, long fileEntryTypeId,
237 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, File file,
238 InputStream is, long size, ServiceContext serviceContext)
239 throws PortalException;
240
241 public DLFileEntry updateStatus(long userId, long fileVersionId,
242 int status, ServiceContext serviceContext,
243 Map<java.lang.String, Serializable> workflowContext)
244 throws PortalException;
245
246 public boolean verifyFileEntryCheckOut(long fileEntryId,
247 java.lang.String lockUuid) throws PortalException;
248
249 public boolean verifyFileEntryLock(long fileEntryId,
250 java.lang.String lockUuid) throws PortalException;
251 }