Message Boards
DL Folder download size exceeds 10 GB then need to display error message an
srini vasulu, modified 3 Years ago.
DL Folder download size exceeds 10 GB then need to display error message an
Regular Member Posts: 139 Join Date: 2/22/11 Recent Posts
Hi all,
DL Folder download size exceeds 10 GB then we need to display error message.
here we deloped the EditFolderMVCResourceCommand class hook like below.
@Component(
property = {
"javax.portlet.name=com_liferay_document_library_web_portlet_DLPortlet",
"javax.portlet.name=com_liferay_document_library_web_portlet_DLAdminPortlet",
"javax.portlet.name=com_liferay_document_library_web_portlet_IGDisplayPortlet",
"mvc.command.name=/document_library/edit_folder",
"service.ranking:Integer=100"
},
service = MVCResourceCommand.class
)
public class FolderDownloadResourceCommand implements MVCResourceCommand {
@Override
public boolean serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
throws PortletException {
// TODO Auto-generated method stub
long repositoryId = ParamUtil.getLong(resourceRequest, "repositoryId");
long folderId = ParamUtil.getLong(resourceRequest, "folderId");
System.out.println(":::::::::***:::::FolderId"+folderId);
try {
double gbData = CommonUtil.getDownloadSize(repositoryId ,folderId, _dlAppService);
if(Validator.isNotNull(maxDownloadsize) && gbData < 10.0) {
mvcResourceCommand.serveResource (resourceRequest, resourceResponse);
}else {
System.out.println("Error message it's more than actual size"); // here it's entering but need to know how to display error message in screen
}
} catch (PortalException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}
@Reference(unbind = "-")
protected void setDLAppService(DLAppService dlAppService) {
_dlAppService = dlAppService;
}
@Reference(target = "(component.name=com.liferay.document.library.web.internal.portlet.action.EditFolderMVCResourceCommand)")
protected MVCResourceCommand mvcResourceCommand;
//private static final Log log = LogFactoryUtil.getLog(FolderDownloadResourceCommand.class);
@Reference
private DLAppService _dlAppService;
}
after enter above else condition then screen displaying blank
Please let me know how we want to do that?
DL Folder download size exceeds 10 GB then we need to display error message.
here we deloped the EditFolderMVCResourceCommand class hook like below.
@Component(
property = {
"javax.portlet.name=com_liferay_document_library_web_portlet_DLPortlet",
"javax.portlet.name=com_liferay_document_library_web_portlet_DLAdminPortlet",
"javax.portlet.name=com_liferay_document_library_web_portlet_IGDisplayPortlet",
"mvc.command.name=/document_library/edit_folder",
"service.ranking:Integer=100"
},
service = MVCResourceCommand.class
)
public class FolderDownloadResourceCommand implements MVCResourceCommand {
@Override
public boolean serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
throws PortletException {
// TODO Auto-generated method stub
long repositoryId = ParamUtil.getLong(resourceRequest, "repositoryId");
long folderId = ParamUtil.getLong(resourceRequest, "folderId");
System.out.println(":::::::::***:::::FolderId"+folderId);
try {
double gbData = CommonUtil.getDownloadSize(repositoryId ,folderId, _dlAppService);
if(Validator.isNotNull(maxDownloadsize) && gbData < 10.0) {
mvcResourceCommand.serveResource (resourceRequest, resourceResponse);
}else {
System.out.println("Error message it's more than actual size"); // here it's entering but need to know how to display error message in screen
}
} catch (PortalException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}
@Reference(unbind = "-")
protected void setDLAppService(DLAppService dlAppService) {
_dlAppService = dlAppService;
}
@Reference(target = "(component.name=com.liferay.document.library.web.internal.portlet.action.EditFolderMVCResourceCommand)")
protected MVCResourceCommand mvcResourceCommand;
//private static final Log log = LogFactoryUtil.getLog(FolderDownloadResourceCommand.class);
@Reference
private DLAppService _dlAppService;
}
after enter above else condition then screen displaying blank
Please let me know how we want to do that?