1
22
23 package com.liferay.portlet.documentlibrary.service.http;
24
25 import com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil;
26
27 import org.json.JSONObject;
28
29
70 public class DLFileEntryServiceJSON {
71 public static JSONObject addFileEntry(long folderId, java.lang.String name,
72 java.lang.String title, java.lang.String description,
73 java.lang.String[] tagsEntries, java.lang.String extraSettings,
74 byte[] byteArray, boolean addCommunityPermissions,
75 boolean addGuestPermissions)
76 throws com.liferay.portal.SystemException,
77 com.liferay.portal.PortalException, java.rmi.RemoteException {
78 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.addFileEntry(folderId,
79 name, title, description, tagsEntries, extraSettings,
80 byteArray, addCommunityPermissions, addGuestPermissions);
81
82 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
83 }
84
85 public static JSONObject addFileEntry(long folderId, java.lang.String name,
86 java.lang.String title, java.lang.String description,
87 java.lang.String[] tagsEntries, java.lang.String extraSettings,
88 byte[] byteArray, java.lang.String[] communityPermissions,
89 java.lang.String[] guestPermissions)
90 throws com.liferay.portal.SystemException,
91 com.liferay.portal.PortalException, java.rmi.RemoteException {
92 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.addFileEntry(folderId,
93 name, title, description, tagsEntries, extraSettings,
94 byteArray, communityPermissions, guestPermissions);
95
96 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
97 }
98
99 public static void deleteFileEntry(long folderId, java.lang.String name)
100 throws com.liferay.portal.SystemException,
101 com.liferay.portal.PortalException, java.rmi.RemoteException {
102 DLFileEntryServiceUtil.deleteFileEntry(folderId, name);
103 }
104
105 public static void deleteFileEntry(long folderId, java.lang.String name,
106 double version)
107 throws com.liferay.portal.SystemException,
108 com.liferay.portal.PortalException, java.rmi.RemoteException {
109 DLFileEntryServiceUtil.deleteFileEntry(folderId, name, version);
110 }
111
112 public static JSONObject getFileEntry(long folderId, java.lang.String name)
113 throws com.liferay.portal.SystemException,
114 com.liferay.portal.PortalException, java.rmi.RemoteException {
115 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntry(folderId,
116 name);
117
118 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
119 }
120
121 public static void lockFileEntry(long folderId, java.lang.String name)
122 throws com.liferay.portal.SystemException,
123 com.liferay.portal.PortalException, java.rmi.RemoteException {
124 DLFileEntryServiceUtil.lockFileEntry(folderId, name);
125 }
126
127 public static void unlockFileEntry(long folderId, java.lang.String name)
128 throws com.liferay.portal.SystemException,
129 com.liferay.portal.PortalException, java.rmi.RemoteException {
130 DLFileEntryServiceUtil.unlockFileEntry(folderId, name);
131 }
132
133 public static JSONObject updateFileEntry(long folderId, long newFolderId,
134 java.lang.String name, java.lang.String sourceFileName,
135 java.lang.String title, java.lang.String description,
136 java.lang.String[] tagsEntries, java.lang.String extraSettings,
137 byte[] byteArray)
138 throws com.liferay.portal.SystemException,
139 com.liferay.portal.PortalException, java.rmi.RemoteException {
140 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.updateFileEntry(folderId,
141 newFolderId, name, sourceFileName, title, description,
142 tagsEntries, extraSettings, byteArray);
143
144 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
145 }
146 }