1

JSF 2.0/ICEfaces ポートレット アプリケーション内で組み込みのコメント機能を使用しようとしています (アプリケーションは既に正常に動作しています)。残念ながら、コメントに関する詳細なドキュメントはまだないようです。そのため、単一の整数にリンクする必要があるコメントを作成および取得する方法を誰かが教えてくれることを願っています。

より明確にするために...カスタムポートレット内で「ページコメント」ポートレットの機能を(再)使用したいのですが、UI部分ではなく、基礎となるサービスのみを使用します。

MBMessageServiceUtil.addDiscussionMessage(...) が EditDiscussionAction クラスを介してそのポートレットで使用されていることは既にわかっています。残念ながら、パラメーター値として何を指定すればよいかわかりません。誰かがこれに光を当てることができますか? javadocはちょっと... 短いです ;-)

public static MBMessage addDiscussionMessage(long groupId,
                                             String className,
                                             long classPK,
                                             String permissionClassName,
                                             long permissionClassPK,
                                             long threadId,
                                             long parentMessageId,
                                             String subject,
                                             String body,
                                             ServiceContext serviceContext)

乾杯、tamm0r

4

1 に答える 1

5

長くなりますが、プレイバイプレイです。

  1. ビューで、MBMessageDisplay オブジェクトを取得します。
    MBMessageDisplay messageDisplay =
       MBMessageLocalServiceUtil.getDiscussionMessageDisplay(
          themeDisplay.getUserId(), themeDisplay.getScopeGroupId(),
          MyModelEntry.class.getName(), myModelEntry.getTasksEntryId(),
          WorkflowConstants.STATUS_APPROVED);
  1. MBMessageDisplay には、threadId や parentMessageId などの重要なデータが含まれるため、必ずこのデータも投稿してください。

  2. 投稿に記載されている呼び出しを行う「コントローラー」で、次のようにリクエストから ServiceContext を取得します。

    ServiceContext serviceContext = ServiceContextFactory.getInstance(
       MyModelEntry.class.getName(), actionRequest);
    
  3. これで、必要なすべてのパラメーターが揃いました。

    long groupId - Group (Organization or Community usually) you're writing the comment in.
    String className - MyModelEntry.class.getName()
    long classPK - MyModelEntry's Primary Key or ID
    String permissionClassName - Model where the permission checker should look, typically the same as className
    long permissionClassPK - Its Primary Key or Id
    long threadId - From MBMessageDisplay.
    long parentMessageId - From MBMessageDisplay.
    String subject - the subject
    String body - the body
    ServiceContext serviceContext - from Request in step 3.
    

お役に立てれば!

于 2011-06-07T23:47:51.143 に答える