4

ネイティブのインポート/エクスポートとアクセス許可の横に、カスタムポートレットの設定にタブを追加しようとしています。

この画像のように:http://imageshack.us/photo/my-images/716/sampledn.png/

このタブでは、変数を定義するconf.propertiesのパラメーターの値を変更できるようにする必要がありました。

どうやってやるの?

よろしく。

4

2 に答える 2

8

うん、まずこれを「ポートレット」ノードの子としてportlet.xmlに追加することでそれを行うことができます。

    <init-param>
        <name>config-jsp</name>
        <value>/html/config.jsp</value>
    </init-param>

liferay-portlet.xmlで、これを「portlet」ノードの子として追加する必要があります。

<configuration-action-class>com.yourportlet.action.ConfigurationActionImpl</configuration-action-class>

次に、XMLで指定したディレクトリにこのファイルを作成する必要があります。また、ConfigurationActionImplは、スケルトンが次のようになるようにConfigurationActionインターフェイスを実装する必要があります。

public class ConfigurationActionImpl implements ConfigurationAction {

@Override
public String render(PortletConfig config, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception {                   
    return "/html/config.jsp";
}

これが役立つか、他に質問がある場合はお知らせください。:)

于 2012-06-18T13:32:46.747 に答える
1

ポートレット.xmlに編集モードを追加します。

    <supports>
        <mime-type>text/html</mime-type>
        <portlet-mode>view</portlet-mode>
        <portlet-mode>edit</portlet-mode> <!-- add this line -->
    </supports>

次に、メニューに設定オプションが表示されます。ポートレットクラスのdoEditメソッドをオーバーライドして、編集モードのコンテンツをレンダリングします。

編集:

より高度なソリューション:

フックを介してポータルjspを変更することにより、別のタブを追加できます。変更する必要のあるjspは次のとおりです。

/html/portlet/portlet_configuration/tabs1.jsp

これにより、すべてのポートレットの構成ウィンドウが変更されることに注意してください。

于 2012-06-18T07:19:08.123 に答える