Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Platform 4.2 以上が必要

...


 
Code Block
<modifications document="nxml">
<remove select="id(‘‘MyWindow’’)">
</modifications>
 
 

このマクロを呼び出す場合:
Code Block

onCommand=”macro://mymacro.execute()"

...

マクロ: 
Code Block
<modifications document=”nxml”>
<remove select="id(''{0}'')">
</modifications>

 


このマクロを呼び出す場合:

 

Code Block

onCommand=”macro://mymacro.execute (‘Window1’) 

 


マクロの定義の概要


次に、マクロの定義に使用される基本フォーマットを示します。

...


次の例では、パラメータを使用したマクロへの呼び出しを示します。

 

Code Block
<macro:macroCall name="generic-dialog" xmlns:macro="http://nexaweb.com/macro" >
<macro:parameter>ThisIt</macro:parameter>
<macro:parameter>true</macro:parameter>
<macro:parameter>true</macro:parameter>
<macro:parameter>false</macro:parameter>
<macro:parameter>Answer</macro:parameter>
</macro:macroCall>

 

次の例では、パラメータを使用したマクロへのイベントハンドラの呼び出しを示します。

<button onCommand="macro://generic-dialog.execute( 'ThisIt', 'true', 'true', 'false', 'Answer' )" />

...

プログラムを使用したマクロの定義と呼び出し


次に、プログラムを使用してマクロを定義する例を示します。

 

Code Block
MacroContainer macroContainer = ClientSession.getMacroContainer();
Macro macro = macroContainer.createMacro
("<xu:modifications xmlns:xu=\"http://nexaweb.com/xupdate\" document=\"nxml\">" +
" <xu:append select=\"/nxml/rootPane[1]\">" +
" <dialog>" +
" <label text=\"Call me Ishmael.Some years ago- never mind how long precisely...\" />" +
  " </dialog>" +
  " </xu:append>" +
  "</xu:modifications>" );
macroContainer.putMacro("nexaweb-examples-herman-melville-dialog", macro);
  

次に、プログラムを使用してマクロを呼び出す例を示します。

 
Code Block
MacroContainer macroContainer = clientSession.getMacroContainer();
Macro melvilleMacro = macroContainer.getMacro( "nexaweb-examples-herman-melville-dialog" );
melvilleMacro.execute();

Macro genericXUpdateMacro = macroContainer.getMacro( "nexaweb-examples-generic-xupdate" );
genericXUpdateMacro.execute( new Object [] { "remove-element", "id('anElementId')", "" } );
genericXUpdateMacro.execute( new Object [] { "append", "/nxml/rootPane[1]", "<dialog><label text=\"Mylabel\"/></dialog>" } );

 

マクロのデバッグとトラブルシューティング

マクロをデバッグするには、アプリケーションのクライアントコンフィギュレーションファイル、nexaweb-client.xmlで、次のようにマクロのデバッグロギングを有効にします。

...