コード例 #1
0
  public List getPages(String nodeId, String title, boolean head)
      throws PortalException, SystemException {

    WikiNode node = WikiNodeUtil.findByPrimaryKey(nodeId);

    return WikiPageUtil.findByN_T_H(nodeId, title, head);
  }
コード例 #2
0
  @Override
  protected PortletPreferences doProcessExportPortletPreferences(
      PortletDataContext portletDataContext,
      String portletId,
      PortletPreferences portletPreferences)
      throws Exception {

    long nodeId = GetterUtil.getLong(portletPreferences.getValue("nodeId", StringPool.BLANK));

    if (nodeId <= 0) {
      if (_log.isWarnEnabled()) {
        _log.warn("No node id found in preferences of portlet " + portletId);
      }

      return portletPreferences;
    }

    String title = portletPreferences.getValue("title", null);

    if (title == null) {
      if (_log.isWarnEnabled()) {
        _log.warn("No title found in preferences of portlet " + portletId);
      }

      return portletPreferences;
    }

    WikiNode node = WikiNodeUtil.fetchByPrimaryKey(nodeId);

    if (node == null) {
      if (_log.isWarnEnabled()) {
        _log.warn("Unable to find wiki node");
      }

      return portletPreferences;
    }

    portletDataContext.addPortletPermissions(WikiPermission.RESOURCE_NAME);

    StagedModelDataHandlerUtil.exportReferenceStagedModel(portletDataContext, portletId, node);

    ActionableDynamicQuery actionableDynamicQuery =
        getPageActionableDynamicQuery(portletDataContext, node.getNodeId(), portletId);

    actionableDynamicQuery.performActions();

    return portletPreferences;
  }