1
22
23 package com.liferay.documentlibrary.util;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.kernel.search.SearchException;
28
29 import java.io.File;
30 import java.io.InputStream;
31
32 import java.util.Date;
33
34
40 public interface Hook {
41
42 public static final double DEFAULT_VERSION = 1.0;
43
44 public void addDirectory(long companyId, long repositoryId, String dirName)
45 throws PortalException, SystemException;
46
47 public void addFile(
48 long companyId, String portletId, long groupId, long repositoryId,
49 String fileName, long fileEntryId, String properties,
50 Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
51 byte[] bytes)
52 throws PortalException, SystemException;
53
54 public void addFile(
55 long companyId, String portletId, long groupId, long repositoryId,
56 String fileName, long fileEntryId, String properties,
57 Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
58 File file)
59 throws PortalException, SystemException;
60
61 public void addFile(
62 long companyId, String portletId, long groupId, long repositoryId,
63 String fileName, long fileEntryId, String properties,
64 Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
65 InputStream is)
66 throws PortalException, SystemException;
67
68 public void checkRoot(long companyId) throws SystemException;
69
70 public void deleteDirectory(
71 long companyId, String portletId, long repositoryId, String dirName)
72 throws PortalException, SystemException;
73
74 public void deleteFile(
75 long companyId, String portletId, long repositoryId,
76 String fileName)
77 throws PortalException, SystemException;
78
79 public void deleteFile(
80 long companyId, String portletId, long repositoryId,
81 String fileName, double versionNumber)
82 throws PortalException, SystemException;
83
84 public byte[] getFile(long companyId, long repositoryId, String fileName)
85 throws PortalException, SystemException;
86
87 public byte[] getFile(
88 long companyId, long repositoryId, String fileName,
89 double versionNumber)
90 throws PortalException, SystemException;
91
92 public InputStream getFileAsStream(
93 long companyId, long repositoryId, String fileName)
94 throws PortalException, SystemException;
95
96 public InputStream getFileAsStream(
97 long companyId, long repositoryId, String fileName,
98 double versionNumber)
99 throws PortalException, SystemException;
100
101 public String[] getFileNames(
102 long companyId, long repositoryId, String dirName)
103 throws PortalException, SystemException;
104
105 public long getFileSize(
106 long companyId, long repositoryId, String fileName)
107 throws PortalException, SystemException;
108
109 public boolean hasFile(
110 long companyId, long repositoryId, String fileName,
111 double versionNumber)
112 throws PortalException, SystemException;
113
114 public void move(String srcDir, String destDir) throws SystemException;
115
116 public void reIndex(String[] ids) throws SearchException;
117
118 public void updateFile(
119 long companyId, String portletId, long groupId, long repositoryId,
120 String fileName, double versionNumber, String sourceFileName,
121 long fileEntryId, String properties, Date modifiedDate,
122 String[] tagsCategories, String[] tagsEntries, byte[] bytes)
123 throws PortalException, SystemException;
124
125 public void updateFile(
126 long companyId, String portletId, long groupId, long repositoryId,
127 String fileName, double versionNumber, String sourceFileName,
128 long fileEntryId, String properties, Date modifiedDate,
129 String[] tagsCategories, String[] tagsEntries, File file)
130 throws PortalException, SystemException;
131
132 public void updateFile(
133 long companyId, String portletId, long groupId, long repositoryId,
134 String fileName, double versionNumber, String sourceFileName,
135 long fileEntryId, String properties, Date modifiedDate,
136 String[] tagsCategories, String[] tagsEntries, InputStream is)
137 throws PortalException, SystemException;
138
139 public void updateFile(
140 long companyId, String portletId, long groupId, long repositoryId,
141 long newRepositoryId, String fileName, long fileEntryId)
142 throws PortalException, SystemException;
143
144 }