001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.documentlibrary.util;
022:
023: import com.liferay.portal.PortalException;
024: import com.liferay.portal.SystemException;
025: import com.liferay.portal.kernel.search.SearchException;
026:
027: import java.io.File;
028: import java.io.InputStream;
029:
030: /**
031: * <a href="Hook.java.html"><b><i>View Source</i></b></a>
032: *
033: * @author Brian Wing Shun Chan
034: *
035: */
036: public interface Hook {
037:
038: public static final double DEFAULT_VERSION = 1.0;
039:
040: public void addDirectory(long companyId, long repositoryId,
041: String dirName) throws PortalException, SystemException;
042:
043: public void addFile(long companyId, String portletId, long groupId,
044: long repositoryId, String fileName, String properties,
045: String[] tagsEntries, File file) throws PortalException,
046: SystemException;
047:
048: public void addFile(long companyId, String portletId, long groupId,
049: long repositoryId, String fileName, String properties,
050: String[] tagsEntries, byte[] byteArray)
051: throws PortalException, SystemException;
052:
053: public void addFile(long companyId, String portletId, long groupId,
054: long repositoryId, String fileName, String properties,
055: String[] tagsEntries, InputStream is)
056: throws PortalException, SystemException;
057:
058: public void checkRoot(long companyId) throws SystemException;
059:
060: public void deleteDirectory(long companyId, String portletId,
061: long repositoryId, String dirName) throws PortalException,
062: SystemException;
063:
064: public void deleteFile(long companyId, String portletId,
065: long repositoryId, String fileName) throws PortalException,
066: SystemException;
067:
068: public void deleteFile(long companyId, String portletId,
069: long repositoryId, String fileName, double versionNumber)
070: throws PortalException, SystemException;
071:
072: public byte[] getFile(long companyId, long repositoryId,
073: String fileName) throws PortalException, SystemException;
074:
075: public byte[] getFile(long companyId, long repositoryId,
076: String fileName, double versionNumber)
077: throws PortalException, SystemException;
078:
079: public InputStream getFileAsStream(long companyId,
080: long repositoryId, String fileName) throws PortalException,
081: SystemException;
082:
083: public InputStream getFileAsStream(long companyId,
084: long repositoryId, String fileName, double versionNumber)
085: throws PortalException, SystemException;
086:
087: public String[] getFileNames(long companyId, long repositoryId,
088: String dirName) throws PortalException, SystemException;
089:
090: public long getFileSize(long companyId, long repositoryId,
091: String fileName) throws PortalException, SystemException;
092:
093: public boolean hasFile(long companyId, long repositoryId,
094: String fileName, double versionNumber)
095: throws PortalException, SystemException;
096:
097: public void move(String srcDir, String destDir)
098: throws SystemException;
099:
100: public void reIndex(String[] ids) throws SearchException;
101:
102: public void updateFile(long companyId, String portletId,
103: long groupId, long repositoryId, String fileName,
104: double versionNumber, String sourceFileName,
105: String properties, String[] tagsEntries, File file)
106: throws PortalException, SystemException;
107:
108: public void updateFile(long companyId, String portletId,
109: long groupId, long repositoryId, String fileName,
110: double versionNumber, String sourceFileName,
111: String properties, String[] tagsEntries, byte[] byteArray)
112: throws PortalException, SystemException;
113:
114: public void updateFile(long companyId, String portletId,
115: long groupId, long repositoryId, String fileName,
116: double versionNumber, String sourceFileName,
117: String properties, String[] tagsEntries, InputStream is)
118: throws PortalException, SystemException;
119:
120: public void updateFile(long companyId, String portletId,
121: long groupId, long repositoryId, long newRepositoryId,
122: String fileName) throws PortalException, SystemException;
123:
124: }
|