1 package com.germinus.merlin.manager.document;
2
3 import java.util.List;
4
5 import org.apache.commons.logging.Log;
6 import org.apache.commons.logging.LogFactory;
7
8 import com.germinus.merlin.model.Document;
9 import com.liferay.portal.SystemException;
10 import com.liferay.portlet.documentlibrary.model.DLFileEntry;
11 import com.liferay.portlet.documentlibrary.model.impl.DLFileEntryImpl;
12 import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
13
14 public abstract class LiferayDocumentLibraryManager implements IDocumentLibraryManager{
15
16 public static final String DEFAULT_FOLDER_NAME = "course";
17 public static final String DEFAULT_FOLDER_DESCRIPTION = "course";
18
19 protected final Log log = LogFactory.getLog(getClass());
20
21 public LiferayDocumentLibraryManager() {
22
23 }
24
25 public int addDocument(String name, String description, long folderId
26 , long companyId) {
27
28 DLFileEntry dlFileEntry = new DLFileEntryImpl();
29
30 dlFileEntry.setName(name);
31 dlFileEntry.setFolderId(folderId);
32 dlFileEntry.setCompanyId(companyId);
33
34 try {
35 DLFileEntryLocalServiceUtil.addDLFileEntry(dlFileEntry);
36 } catch (SystemException e) {
37 e.printStackTrace();
38 }
39 return 0;
40 }
41
42 public int deleteDocument(String name) {
43
44 return 0;
45 }
46
47 public List<Document> getDocumentsList(long companyId ,long communityId, String dirName ) {
48
49 return null;
50 }
51 public List<Long> getFolderIdList(long communityId) {
52
53 return null;
54 }
55 public int moveDocument(long communityId, long documentId,
56 long destResourceContainer) {
57
58 return 0;
59 }
60
61 public int updateDocument(long communityId, long documentId, String name,
62 String description) {
63
64 return 0;
65 }
66 }