Package com.dotmarketing.business

Examples of com.dotmarketing.business.Layout


        if(changedLayout.equals(l.getId())) {
          found = true;
          break;
        }
      }
      Layout layout = layoutAPI.loadLayout(changedLayout);
      if(!found) {
        roleAPI.addLayoutToRole(layout, role);
      }
    }
  }
View Full Code Here


  }

  public Map<String, Object> addNewLayout(String layoutName, String layoutDescription, int order, List<String> portletIds) throws DotDataException, LanguageException, DotRuntimeException, PortalException, SystemException {

    LayoutAPI layoutAPI = APILocator.getLayoutAPI();
    Layout newLayout = new Layout();
    newLayout.setName(layoutName);
    newLayout.setDescription(layoutDescription);
    newLayout.setTabOrder(order);
    layoutAPI.saveLayout(newLayout);

    layoutAPI.setPortletIdsToLayout(newLayout, portletIds);

    Map<String, Object> layoutMap =  newLayout.toMap();
    layoutMap.put("portletTitles", getPorletTitlesFromLayout(newLayout));
    return layoutMap;

  }
View Full Code Here

  public void updateLayout(String layoutId, String layoutName, String layoutDescription, int order, List<String> portletIds) throws DotDataException {

    LayoutAPI layoutAPI = APILocator.getLayoutAPI();

    Layout layout = layoutAPI.findLayout(layoutId);
    layout.setName(layoutName);
    layout.setTabOrder(order);
    layout.setDescription(layoutDescription);
    layoutAPI.saveLayout(layout);

    layoutAPI.setPortletIdsToLayout(layout, portletIds);

  }
View Full Code Here

  }
  public void deleteLayout(String layoutId) throws DotDataException {

    LayoutAPI layoutAPI = APILocator.getLayoutAPI();
    Layout layout = layoutAPI.loadLayout(layoutId);
    layoutAPI.removeLayout(layout);

  }
View Full Code Here

        if ((userLayouts == null) || (userLayouts.size() == 0) || !UtilMethods.isSet(userLayouts.get(0).getId())) {
          new LogoutAction().execute(mapping, form, req, res);
          throw new RequiredLayoutException();
        }
       
        Layout layout = userLayouts.get(0);
        List<String> portletIds = layout.getPortletIds();
        String portletId = portletIds.get(0);
        java.util.Map<String, String[]> params = new java.util.HashMap<String, String[]>();
        params.put("struts_action",new String[] {"/ext/director/direct"});
        String directorURL = com.dotmarketing.util.PortletURLUtil.getActionURL(req,layout.getId(),WindowState.MAXIMIZED.toString(),params, portletId);
        ses.setAttribute(com.dotmarketing.util.WebKeys.DIRECTOR_URL, directorURL);
       

        // Touch protected resource
        return mapping.findForward("/portal/touch_protected.jsp");
View Full Code Here

//            }
          }else if (action != null && action.equals("0")) {
          _processRenderRequest(req, res);
        }
       
        Layout layout = (Layout)req.getAttribute(WebKeys.LAYOUT);

        if (layout != null) {
          _updateLayout(req, layout);
        }
View Full Code Here

  }

  private void _forwardLayout(HttpServletRequest req) throws Exception {
    HttpSession ses = req.getSession();

    Layout layout = (Layout)req.getAttribute(WebKeys.LAYOUT);
   
   
    String layoutId = null;

    if (layout == null || !InodeUtils.isSet(layoutId)) {
      User user = PortalUtil.getUser(req);
      List<Layout> userLayouts = APILocator.getLayoutAPI().loadLayoutsForUser(user);
      if(userLayouts != null && userLayouts.size() > 0){
        layoutId = userLayouts.get(0).getId();
      }
    }else{
      layoutId = layout.getId();
    }

    String ctxPath = (String)ses.getAttribute(WebKeys.CTX_PATH);

    req.setAttribute(
View Full Code Here

      req = uploadReq;
    }

    String companyId = PortalUtil.getCompanyId(req);
    User user = PortalUtil.getUser(req);
    Layout layout = (Layout)req.getAttribute(WebKeys.LAYOUT);
    String portletId = ParamUtil.getString(req, "p_p_id");

    Portlet portlet =
      PortletManagerUtil.getPortletById(companyId, portletId);

    ServletContext ctx = (ServletContext)req.getAttribute(WebKeys.CTX);

    CachePortlet cachePortlet = PortalUtil.getPortletInstance(portlet, ctx);

    if (user != null) {
      CachePortlet.clearResponse(ses, layout, portletId);
    }

//    PortletPreferences portletPrefs =
//      PortletPreferencesManagerUtil.getPreferences(
//        companyId, PortalUtil.getPortletPreferencesPK(req, portletId));

    PortletPreferences portletPrefs = null;
   
    PortletConfig portletConfig = PortalUtil.getPortletConfig(portlet, ctx);
    PortletContext portletCtx = portletConfig.getPortletContext();

    WindowState windowState = new WindowState(
      ParamUtil.getString(req, "p_p_state"));

    PortletMode portletMode = new PortletMode(
      ParamUtil.getString(req, "p_p_mode"));

    if (action) {
      ActionRequestImpl actionRequest = new ActionRequestImpl(
        req, portlet, cachePortlet, portletCtx, windowState,
        portletMode, portletPrefs, layout.getId());

      ActionResponseImpl actionResponse = new ActionResponseImpl(
        actionRequest, res, portletId, user, layout, windowState,
        portletMode);

      actionRequest.defineObjects(portletConfig, actionResponse);

      cachePortlet.processAction(actionRequest, actionResponse);

      RenderParametersPool.put(
        req, layout.getId(), portletId,
        actionResponse.getRenderParameters());
    }
    else {
//      PortalUtil.updateWindowState(portletId, user, layout, windowState);
//
View Full Code Here

        User user = WebAPILocator.getUserWebAPI().getLoggedInUser(req);
        List<Layout>layouts = APILocator.getLayoutAPI().loadLayoutsForUser(user);
        if(layouts.size()==0){
          return null;
        }
        Layout layout = layouts.get(0);
        List<String> portletIds = layout.getPortletIds();
        portletName = portletIds.get(0);
        return getActionURL(req, layout.getId(), _windowState, _params, portletName);
      } catch (Exception e) {
        Logger.error(PortletURLUtil.class, e.toString(), e);
      }
    } else {
      portletName = portletConfig.getPortletId();
View Full Code Here

 
  }
 
  public static String getActionURL(HttpServletRequest req, String _windowState, Map _params, String portletName) {
   
    Layout layout = (Layout) req.getAttribute(WebKeys.LAYOUT);
    return getActionURL(req, layout.getId(), _windowState, _params, portletName);
  }
View Full Code Here

TOP

Related Classes of com.dotmarketing.business.Layout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.