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.portlet.documentlibrary.service;
022:
023: /**
024: * <a href="DLFileEntryServiceUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * <p>
027: * ServiceBuilder generated this class. Modifications in this class will be
028: * overwritten the next time is generated.
029: * </p>
030: *
031: * <p>
032: * This class provides static methods for the
033: * <code>com.liferay.portlet.documentlibrary.service.DLFileEntryService</code>
034: * bean. The static methods of this class calls the same methods of the bean
035: * instance. It's convenient to be able to just write one line to call a method
036: * on a bean instead of writing a lookup call and a method call.
037: * </p>
038: *
039: * <p>
040: * <code>com.liferay.portlet.documentlibrary.service.DLFileEntryServiceFactory</code>
041: * is responsible for the lookup of the bean.
042: * </p>
043: *
044: * @author Brian Wing Shun Chan
045: *
046: * @see com.liferay.portlet.documentlibrary.service.DLFileEntryService
047: * @see com.liferay.portlet.documentlibrary.service.DLFileEntryServiceFactory
048: *
049: */
050: public class DLFileEntryServiceUtil {
051: public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
052: long folderId, java.lang.String name,
053: java.lang.String title, java.lang.String description,
054: java.lang.String[] tagsEntries,
055: java.lang.String extraSettings, byte[] byteArray,
056: boolean addCommunityPermissions, boolean addGuestPermissions)
057: throws com.liferay.portal.PortalException,
058: com.liferay.portal.SystemException,
059: java.rmi.RemoteException {
060: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
061: .getService();
062:
063: return dlFileEntryService.addFileEntry(folderId, name, title,
064: description, tagsEntries, extraSettings, byteArray,
065: addCommunityPermissions, addGuestPermissions);
066: }
067:
068: public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
069: long folderId, java.lang.String name,
070: java.lang.String title, java.lang.String description,
071: java.lang.String[] tagsEntries,
072: java.lang.String extraSettings, byte[] byteArray,
073: java.lang.String[] communityPermissions,
074: java.lang.String[] guestPermissions)
075: throws com.liferay.portal.PortalException,
076: com.liferay.portal.SystemException,
077: java.rmi.RemoteException {
078: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
079: .getService();
080:
081: return dlFileEntryService.addFileEntry(folderId, name, title,
082: description, tagsEntries, extraSettings, byteArray,
083: communityPermissions, guestPermissions);
084: }
085:
086: public static void deleteFileEntry(long folderId,
087: java.lang.String name)
088: throws com.liferay.portal.PortalException,
089: com.liferay.portal.SystemException,
090: java.rmi.RemoteException {
091: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
092: .getService();
093:
094: dlFileEntryService.deleteFileEntry(folderId, name);
095: }
096:
097: public static void deleteFileEntry(long folderId,
098: java.lang.String name, double version)
099: throws com.liferay.portal.PortalException,
100: com.liferay.portal.SystemException,
101: java.rmi.RemoteException {
102: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
103: .getService();
104:
105: dlFileEntryService.deleteFileEntry(folderId, name, version);
106: }
107:
108: public static void deleteFileEntryByTitle(long folderId,
109: java.lang.String titleWithExtension)
110: throws com.liferay.portal.PortalException,
111: com.liferay.portal.SystemException,
112: java.rmi.RemoteException {
113: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
114: .getService();
115:
116: dlFileEntryService.deleteFileEntryByTitle(folderId,
117: titleWithExtension);
118: }
119:
120: public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
121: long folderId, java.lang.String name)
122: throws com.liferay.portal.PortalException,
123: com.liferay.portal.SystemException,
124: java.rmi.RemoteException {
125: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
126: .getService();
127:
128: return dlFileEntryService.getFileEntry(folderId, name);
129: }
130:
131: public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
132: long folderId, java.lang.String titleWithExtension)
133: throws com.liferay.portal.PortalException,
134: com.liferay.portal.SystemException,
135: java.rmi.RemoteException {
136: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
137: .getService();
138:
139: return dlFileEntryService.getFileEntryByTitle(folderId,
140: titleWithExtension);
141: }
142:
143: public static void lockFileEntry(long folderId,
144: java.lang.String name)
145: throws com.liferay.portal.PortalException,
146: com.liferay.portal.SystemException,
147: java.rmi.RemoteException {
148: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
149: .getService();
150:
151: dlFileEntryService.lockFileEntry(folderId, name);
152: }
153:
154: public static void unlockFileEntry(long folderId,
155: java.lang.String name)
156: throws com.liferay.portal.PortalException,
157: com.liferay.portal.SystemException,
158: java.rmi.RemoteException {
159: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
160: .getService();
161:
162: dlFileEntryService.unlockFileEntry(folderId, name);
163: }
164:
165: public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
166: long folderId, long newFolderId, java.lang.String name,
167: java.lang.String sourceFileName, java.lang.String title,
168: java.lang.String description,
169: java.lang.String[] tagsEntries,
170: java.lang.String extraSettings, byte[] byteArray)
171: throws com.liferay.portal.PortalException,
172: com.liferay.portal.SystemException,
173: java.rmi.RemoteException {
174: DLFileEntryService dlFileEntryService = DLFileEntryServiceFactory
175: .getService();
176:
177: return dlFileEntryService.updateFileEntry(folderId,
178: newFolderId, name, sourceFileName, title, description,
179: tagsEntries, extraSettings, byteArray);
180: }
181: }
|