Fórum

Check file size against Document Library size when uploading user's file

thumbnail
Darth Lord, modificado 13 Anos atrás.

Check file size against Document Library size when uploading user's file

New Member Postagens: 8 Data de Entrada: 21/05/10 Postagens Recentes
Hi,

This is my first time posting here and would try to be as detailed as possible.emoticon

Here is my current configuration:

  • Liferay 6.0.5
  • Database: MySQL
  • Solr search for ducument search
  • OS. Windows 7 Pro
  • IDE: NetBeans 7.0 Beta
  • SDK: NetBeans Portal Pack 3.0.4


I am try to implement a funtionality that will allow me to set user's document library size depending on the user's role. As follow:

Users belonging to the Marketing deparment can have 10Gb space
Users belonging to the Finance department can have upto 2Gb space, etc...

Liferay tables already records the size of each document for a user and companies. I want to be able check the user document size and make sure that it doesn't go over his allowed limit.

I am trying to override "edit_file_entry.jsp" in /html/portlet/document_library/ as this is the JSP which uploads files to the Document Library. I have been going through the JSP but I am not sure where exactly I can make the necessary changes in the file to retrieve the current size of the user and or company Document Library size and compare it with the current file being uploaded.

I can write my own portlet to provide the same functionality but I was thinking of re-using current code and amend as required.

Thanks
thumbnail
Samuel Kong, modificado 13 Anos atrás.

RE: Check file size against Document Library size when uploading user'

Liferay Legend Postagens: 1902 Data de Entrada: 10/03/08 Postagens Recentes
Take a look at the Wrapper Plugins wiki page.

Use a wrapper to override the add, delete and update methods in com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService

You'll need to create your own method of tracking how much space a user has used, but you should do the check in DLFileEntryLocalService.
thumbnail
Darth Lord, modificado 12 Anos atrás.

RE: Check file size against Document Library size when uploading user'

New Member Postagens: 8 Data de Entrada: 21/05/10 Postagens Recentes
for your reply and sorry for the delay. I will look into it.
thumbnail
Darth Lord, modificado 12 Anos atrás.

RE: Check file size against Document Library size when uploading user'

New Member Postagens: 8 Data de Entrada: 21/05/10 Postagens Recentes
for your reply and sorry for the delay. I will look into it.