public static com.nss.portlet.journal.model.JournalFeedSoap addFeed(
      long groupId,
      java.lang.String feedId,
      boolean autoFeedId,
      java.lang.String name,
      java.lang.String description,
      java.lang.String type,
      java.lang.String structureId,
      java.lang.String templateId,
      java.lang.String rendererTemplateId,
      int delta,
      java.lang.String orderByCol,
      java.lang.String orderByType,
      java.lang.String targetLayoutFriendlyUrl,
      java.lang.String targetPortletId,
      java.lang.String contentField,
      java.lang.String feedType,
      double feedVersion,
      com.liferay.portal.service.ServiceContext serviceContext)
      throws RemoteException {
    try {
      com.nss.portlet.journal.model.JournalFeed returnValue =
          JournalFeedServiceUtil.addFeed(
              groupId,
              feedId,
              autoFeedId,
              name,
              description,
              type,
              structureId,
              templateId,
              rendererTemplateId,
              delta,
              orderByCol,
              orderByType,
              targetLayoutFriendlyUrl,
              targetPortletId,
              contentField,
              feedType,
              feedVersion,
              serviceContext);

      return com.nss.portlet.journal.model.JournalFeedSoap.toSoapModel(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
Exemple #2
0
  protected void updateFeed(ActionRequest actionRequest) throws Exception {
    String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

    long groupId = ParamUtil.getLong(actionRequest, "groupId");

    String feedId = ParamUtil.getString(actionRequest, "feedId");
    boolean autoFeedId = ParamUtil.getBoolean(actionRequest, "autoFeedId");

    String name = ParamUtil.getString(actionRequest, "name");
    String description = ParamUtil.getString(actionRequest, "description");
    String type = ParamUtil.getString(actionRequest, "type");
    String structureId = ParamUtil.getString(actionRequest, "structureId");
    String templateId = ParamUtil.getString(actionRequest, "templateId");
    String rendererTemplateId = ParamUtil.getString(actionRequest, "rendererTemplateId");
    int delta = ParamUtil.getInteger(actionRequest, "delta");
    String orderByCol = ParamUtil.getString(actionRequest, "orderByCol");
    String orderByType = ParamUtil.getString(actionRequest, "orderByType");
    String targetLayoutFriendlyUrl = ParamUtil.getString(actionRequest, "targetLayoutFriendlyUrl");
    String targetPortletId = ParamUtil.getString(actionRequest, "targetPortletId");
    String contentField = ParamUtil.getString(actionRequest, "contentField");

    String feedType = RSSUtil.DEFAULT_TYPE;
    double feedVersion = RSSUtil.DEFAULT_VERSION;

    String feedTypeAndVersion = ParamUtil.getString(actionRequest, "feedTypeAndVersion");

    if (Validator.isNotNull(feedTypeAndVersion)) {
      String[] parts = feedTypeAndVersion.split(StringPool.COLON);

      try {
        feedType = parts[0];
        feedVersion = GetterUtil.getDouble(parts[1]);
      } catch (Exception e) {
      }
    } else {
      feedType = ParamUtil.getString(actionRequest, "feedType", feedType);
      feedVersion = ParamUtil.getDouble(actionRequest, "feedVersion", feedVersion);
    }

    ServiceContext serviceContext =
        ServiceContextFactory.getInstance(JournalFeed.class.getName(), actionRequest);

    if (cmd.equals(Constants.ADD)) {

      // Add feed

      JournalFeedServiceUtil.addFeed(
          groupId,
          feedId,
          autoFeedId,
          name,
          description,
          type,
          structureId,
          templateId,
          rendererTemplateId,
          delta,
          orderByCol,
          orderByType,
          targetLayoutFriendlyUrl,
          targetPortletId,
          contentField,
          feedType,
          feedVersion,
          serviceContext);
    } else {

      // Update feed

      JournalFeedServiceUtil.updateFeed(
          groupId,
          feedId,
          name,
          description,
          type,
          structureId,
          templateId,
          rendererTemplateId,
          delta,
          orderByCol,
          orderByType,
          targetLayoutFriendlyUrl,
          targetPortletId,
          contentField,
          feedType,
          feedVersion,
          serviceContext);
    }
  }