| 1 package com.dotmarketing.portlets.files.action; 2 3 import javax.portlet.PortletConfig; 4 import javax.portlet.RenderRequest; 5 import javax.portlet.RenderResponse; 6 import javax.portlet.WindowState; 7 import javax.servlet.jsp.PageContext ; 8 9 import org.apache.struts.action.ActionForm; 10 import org.apache.struts.action.ActionForward; 11 import org.apache.struts.action.ActionMapping; 12 13 import com.dotmarketing.portal.struts.DotPortletAction; 14 import com.dotmarketing.portlets.files.model.File; 15 import com.dotmarketing.util.Logger; 16 import com.dotmarketing.util.WebKeys; 17 import com.liferay.portal.model.User; 18 import com.liferay.portal.util.Constants; 19 20 27 public class ViewFilesAction extends DotPortletAction { 28 29 32 public ActionForward render( 33 ActionMapping mapping, ActionForm form, PortletConfig config, 34 RenderRequest req, RenderResponse res) 35 throws Exception { 36 37 Logger.debug(this, "Running ViewFilesAction!!!!"); 38 39 try { 40 User user = _getUser(req); 42 43 if (req.getWindowState().equals(WindowState.NORMAL)) { 44 return mapping.findForward("portlet.ext.files.view"); 45 } 46 else { 47 48 _viewWebAssets(req, user, File.class, "file_asset", WebKeys.FILES_VIEW_COUNT, WebKeys.FILES_VIEW, WebKeys.FILE_QUERY, WebKeys.FILE_SHOW_DELETED); 49 return mapping.findForward("portlet.ext.files.view_files"); 50 } 51 } 52 catch (Exception e) { 53 req.setAttribute(PageContext.EXCEPTION, e); 54 return mapping.findForward(Constants.COMMON_ERROR); 55 } 56 } 57 } | Popular Tags |