1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.documentlibrary.service;
21  
22  import com.liferay.portal.PortalException;
23  import com.liferay.portal.SystemException;
24  import com.liferay.portal.kernel.annotation.Transactional;
25  
26  import java.io.File;
27  
28  import java.util.Date;
29  
30  /**
31   * <a href="DLService.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Brian Wing Shun Chan
34   *
35   */
36  @Transactional(rollbackFor = {PortalException.class, SystemException.class})
37  public interface DLService {
38  
39      public void addDirectory(long companyId, long repositoryId, String dirName)
40          throws PortalException, SystemException;
41  
42      public void addFile(
43              long companyId, String portletId, long groupId, long repositoryId,
44              String fileName, long fileEntryId, String properties,
45              Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
46              File file)
47          throws PortalException, SystemException;
48  
49      public void addFile(
50              long companyId, String portletId, long groupId, long repositoryId,
51              String fileName, long fileEntryId, String properties,
52              Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
53              byte[] bytes)
54          throws PortalException, SystemException;
55  
56      public void deleteDirectory(
57              long companyId, String portletId, long repositoryId, String dirName)
58          throws PortalException, SystemException;
59  
60      public void deleteFile(
61              long companyId, String portletId, long repositoryId,
62              String fileName)
63          throws PortalException, SystemException;
64  
65      public void deleteFile(
66              long companyId, String portletId, long repositoryId,
67              String fileName, double versionNumber)
68          throws PortalException, SystemException;
69  
70      public byte[] getFile(long companyId, long repositoryId, String fileName)
71          throws PortalException, SystemException;
72  
73      public byte[] getFile(
74              long companyId, long repositoryId, String fileName,
75              double versionNumber)
76          throws PortalException, SystemException;
77  
78      public String[] getFileNames(
79              long companyId, long repositoryId, String dirName)
80          throws PortalException, SystemException;
81  
82      public long getFileSize(
83              long companyId, long repositoryId, String fileName)
84          throws PortalException, SystemException;
85  
86      public void reIndex(String[] ids) throws SystemException;
87  
88      public void updateFile(
89              long companyId, String portletId, long groupId, long repositoryId,
90              String fileName, double versionNumber, String sourceFileName,
91              long fileEntryId, String properties, Date modifiedDate,
92              String[] tagsCategories, String[] tagsEntries, File file)
93          throws PortalException, SystemException;
94  
95      public void updateFile(
96              long companyId, String portletId, long groupId, long repositoryId,
97              String fileName, double versionNumber, String sourceFileName,
98              long fileEntryId, String properties, Date modifiedDate,
99              String[] tagsCategories, String[] tagsEntries, byte[] bytes)
100         throws PortalException, SystemException;
101 
102     public void updateFile(
103             long companyId, String portletId, long groupId, long repositoryId,
104             long newRepositoryId, String fileName, long fileEntryId)
105         throws PortalException, SystemException;
106 
107 }