View Javadoc
1   package com.germinus.merlin.manager.document;
2   
3   import java.rmi.RemoteException;
4   
5   import javax.portlet.RenderRequest;
6   
7   import com.germinus.merlin.model.Document;
8   import com.germinus.liferay.util.ILiferayUtil;
9   import com.liferay.portal.PortalException;
10  import com.liferay.portal.SystemException;
11  import com.liferay.portal.kernel.util.ParamUtil;
12  import com.liferay.portlet.documentlibrary.DuplicateFolderNameException;
13  import com.liferay.portlet.documentlibrary.model.DLFileEntry;
14  import com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil;
15  
16  public class MerlinDocumentLibraryManager extends LiferayDocumentLibraryManager
17  implements IMerlinDLManager{
18  
19  	private ILiferayUtil liferayUtil;
20  	
21  	public MerlinDocumentLibraryManager(){
22  		
23  	}
24  	
25  	public int addFolder(long plid, long parenFolderId, String name,
26  			String description) {
27  		// TODO Falta por implementar
28  		return 0;
29  	}
30  	
31  	public int deleteDocument(long fileEntryId) {
32  		// TODO Falta por implementar
33  		return 0;
34  	}
35  	
36  	public int deleteFolder(long folderId) {
37  		// TODO Falta por implementar
38  		return 0;
39  	}
40  	
41  	public int deleteFolder(String name, long parenFolderId) {
42  		// TODO Falta por implementar
43  		return 0;
44  	}
45  
46  	public int initialize(RenderRequest request)
47  	{
48  		//TODO implementar la creación de los ficheros del document library para merlín
49  //		try {
50  //			long plid = liferayUtil.getPlid(request);
51  //			long folderId = ParamUtil.getLong(request, "folderId");
52  //			long parentFolderId = ParamUtil.getLong(request, "parentFolderId");
53  //
54  //			String[] communityPermissions = request.getParameterValues(
55  //				"communityPermissions");
56  //			String[] guestPermissions = request.getParameterValues("guestPermissions");
57  //
58  //			if (folderId <= 0) {
59  //				DLFolderServiceUtil.addFolder(plid, parentFolderId, DEFAULT_FOLDER_NAME, 
60  //						DEFAULT_FOLDER_DESCRIPTION,	communityPermissions, guestPermissions);
61  //			}
62  //			log.debug("Create a folder to save the course files");
63  //			
64  //		} catch (DuplicateFolderNameException e) {
65  //			log.error("The course files folder had already been created");
66  //		} catch (PortalException e) {
67  //			//e.printStackTrace();
68  //			log.error("The user has not permission to add the course files folder");
69  //		} catch (RemoteException e) {
70  //			e.printStackTrace();
71  //		} catch (SystemException e) {
72  //			e.printStackTrace();
73  //		} 
74  		return 1;
75  	}
76  
77  	public void revertTestMethod(RenderRequest request)
78  	{
79  		
80  	}
81  
82  	public Document searchDocument(String name, long folderId) {
83  		// TODO Falta por implementar
84  		return null;
85  	}
86  
87  	public DLFileEntry searchFile(String name, long folderId) {
88  		// TODO Falta por implementar
89  		return null;
90  	}
91  
92  	public void testMethod(RenderRequest request)
93  	{
94  		initialize(request);
95  		//addDocument("prueba1", "descripcion prueba1", folderId, companyId);
96  			
97  	}
98  
99  	public int addDocument(Document document, int resourceContainerId) {
100 		// TODO Falta por implementar
101 		return 0;
102 	}
103 
104 	public int deleteDocument(Document document, int resourceContainerId) {
105 		// TODO Falta por implementar
106 		return 0;
107 	}
108 
109 	public int updateDocument(long documentId, Document document) {
110 		// TODO Falta por implementar
111 		return 0;
112 	}
113 
114 	/**
115 	 * @return the liferayUtil
116 	 */
117 	public ILiferayUtil getLiferayUtil() {
118 		return liferayUtil;
119 	}
120 
121 	/**
122 	 * @param liferayUtil the liferayUtil to set
123 	 */
124 	public void setLiferayUtil(ILiferayUtil liferayUtil) {
125 		this.liferayUtil = liferayUtil;
126 	}
127 
128 }