1 package com.dotmarketing.portlets.structure.action; 2 3 import java.util.List ; 4 5 import javax.portlet.PortletConfig; 6 import javax.portlet.RenderRequest; 7 import javax.portlet.RenderResponse; 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.structure.factories.RelationshipFactory; 15 import com.dotmarketing.util.UtilMethods; 16 import com.dotmarketing.util.WebKeys; 17 18 public class ViewRelationshipsAction extends DotPortletAction { 19 public ActionForward render(ActionMapping mapping, ActionForm form, 20 PortletConfig config, RenderRequest req, RenderResponse res) 21 throws Exception { 22 String orderBy = req.getParameter("orderBy"); 23 orderBy = (UtilMethods.isSet(orderBy) ? orderBy : "relationship.inode"); 24 _loadRelationships(form, req, res, orderBy); 25 return mapping.findForward("portlet.ext.structure.view_relationships"); 26 } 27 28 private void _loadRelationships(ActionForm form, RenderRequest req, 29 RenderResponse res, String orderBy) { 30 List list = RelationshipFactory.getRelationships(orderBy); 31 req.setAttribute(WebKeys.Relationship.RELATIONSHIPS, list); 32 } 33 } 34 | Popular Tags |