@Override
  public PortletURL getURLAdd(
      LiferayPortletRequest liferayPortletRequest,
      LiferayPortletResponse liferayPortletResponse,
      long classTypeId)
      throws PortalException {

    ThemeDisplay themeDisplay =
        (ThemeDisplay) liferayPortletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    CalendarResource calendarResource =
        CalendarResourceUtil.getScopeGroupCalendarResource(
            liferayPortletRequest, themeDisplay.getScopeGroupId());

    if (calendarResource == null) {
      return null;
    }

    PortletURL portletURL =
        PortalUtil.getControlPanelPortletURL(
            liferayPortletRequest, CalendarPortletKeys.CALENDAR, PortletRequest.RENDER_PHASE);

    portletURL.setParameter("mvcPath", "/edit_calendar_booking.jsp");

    Calendar calendar = calendarResource.getDefaultCalendar();

    portletURL.setParameter("calendarId", String.valueOf(calendar.getCalendarId()));

    return portletURL;
  }
  @Override
  public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    PortletURL portletURL =
        PortalUtil.getControlPanelPortletURL(
            portletRequest, MBPortletKeys.MESSAGE_BOARDS_ADMIN, PortletRequest.ACTION_PHASE);

    portletURL.setParameter(ActionRequest.ACTION_NAME, "/message_boards/edit_message");

    try {
      MBMessage message = ActionUtil.getMessage(portletRequest);

      MBThread thread = message.getThread();

      if (thread.isLocked()) {
        portletURL.setParameter(Constants.CMD, Constants.UNLOCK);
      } else {
        portletURL.setParameter(Constants.CMD, Constants.LOCK);
      }

      portletURL.setParameter("redirect", PortalUtil.getCurrentURL(portletRequest));
      portletURL.setParameter("threadId", String.valueOf(thread.getThreadId()));
    } catch (Exception e) {
      return null;
    }

    return portletURL.toString();
  }
예제 #3
0
  @JSON(include = false)
  public PortletURL getURLUpdateManager() {
    if (_urlUpdateManager == null) {
      _urlUpdateManager =
          PortalUtil.getControlPanelPortletURL(
              getRequest(), PortletKeys.MARKETPLACE_STORE, PortletRequest.RENDER_PHASE);
    }

    return _urlUpdateManager;
  }
예제 #4
0
  /** @deprecated As of 7.0.0, with no direct replacement */
  @Deprecated
  @JSON(include = false)
  public PortletURL getURLPageSettings() {
    if (_urlPageSettings == null) {
      String portletId =
          PortletProviderUtil.getPortletId(Layout.class.getName(), PortletProvider.Action.EDIT);

      _urlPageSettings =
          PortalUtil.getControlPanelPortletURL(
              getRequest(), portletId, PortletRequest.RENDER_PHASE);
    }

    return _urlPageSettings;
  }
예제 #5
0
  @JSON(include = false)
  public PortletURL getURLMyAccount() {
    if (_urlMyAccount == null) {
      String portletId =
          PortletProviderUtil.getPortletId(
              PortalMyAccountApplicationType.MyAccount.CLASS_NAME, PortletProvider.Action.VIEW);

      _urlMyAccount =
          PortalUtil.getControlPanelPortletURL(
              getRequest(), portletId, PortletRequest.RENDER_PHASE);
    }

    return _urlMyAccount;
  }
  @Override
  public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    PortletURL portletURL =
        PortalUtil.getControlPanelPortletURL(
            portletRequest, DLPortletKeys.DOCUMENT_LIBRARY_ADMIN, PortletRequest.RENDER_PHASE);

    portletURL.setParameter("mvcPath", "/document_library/view_file_entry_types.jsp");

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    portletURL.setParameter("redirect", themeDisplay.getURLCurrent());

    return portletURL.toString();
  }
  @Override
  public String getURL() {
    ResourceURL portletURL =
        (ResourceURL)
            PortalUtil.getControlPanelPortletURL(
                portletRequest,
                DLPortletKeys.DOCUMENT_LIBRARY_ADMIN,
                PortletRequest.RESOURCE_PHASE);

    portletURL.setResourceID("/document_library/edit_folder");
    portletURL.setParameter("folderId", String.valueOf(_folder.getFolderId()));
    portletURL.setParameter("repositoryId", String.valueOf(_folder.getRepositoryId()));

    return portletURL.toString();
  }
  @Override
  public String getURLEditWorkflowTask(long workflowTaskId, ServiceContext serviceContext)
      throws PortalException {

    try {
      PortletURL portletURL =
          PortalUtil.getControlPanelPortletURL(
              serviceContext.getRequest(),
              PortletKeys.MY_WORKFLOW_TASK,
              PortletRequest.RENDER_PHASE);

      portletURL.setParameter("mvcPath", "/edit_workflow_task.jsp");
      portletURL.setParameter("workflowTaskId", String.valueOf(workflowTaskId));
      portletURL.setWindowState(WindowState.MAXIMIZED);

      return portletURL.toString();
    } catch (WindowStateException wse) {
      throw new PortalException(wse);
    }
  }
  @Override
  public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    PortletURL portletURL =
        PortalUtil.getControlPanelPortletURL(
            portletRequest, BookmarksPortletKeys.BOOKMARKS_ADMIN, PortletRequest.RENDER_PHASE);

    portletURL.setParameter("mvcRenderCommandName", "/bookmarks/move_entry");
    portletURL.setParameter("redirect", PortalUtil.getCurrentURL(portletRequest));

    BookmarksFolder folder = null;

    try {
      folder = ActionUtil.getFolder(portletRequest);
    } catch (Exception e) {
      return null;
    }

    portletURL.setParameter("rowIdsBookmarksFolder", String.valueOf(folder.getFolderId()));

    return portletURL.toString();
  }
  @Override
  public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    PortletURL portletURL =
        PortalUtil.getControlPanelPortletURL(
            portletRequest, MBPortletKeys.MESSAGE_BOARDS_ADMIN, PortletRequest.RENDER_PHASE);

    portletURL.setParameter("mvcRenderCommandName", "/message_boards/move_thread");
    portletURL.setParameter("redirect", PortalUtil.getCurrentURL(portletRequest));

    try {
      MBCategory category = ActionUtil.getCategory(portletRequest);

      portletURL.setParameter("mbCategoryId", String.valueOf(getCategoryId(category)));

      MBMessage message = ActionUtil.getMessage(portletRequest);

      portletURL.setParameter("threadId", String.valueOf(message.getThreadId()));
    } catch (Exception e) {
      return null;
    }

    return portletURL.toString();
  }