カスタムコマンド定義の例
例: プロパティ置換を使用した URL の一部の置換
このカスタムコマンドには Button Label というラベルが付き、ツールヒントなどがあります。さらに、このコマンドをアクティブ化した場合、現在選択されている部分で、指定されているプロパティ (Source_file_name) の有無がチェックされます。見つからない場合、このボタンは有効になりません。見つかった場合、URL 内のサブ文字列が置き換えられます。
<menu
ui="rmb"
view="all"
pane="all"
select="any"
visible="getSelectedCount()==1 && getPropertyExists('Source_file_name')">
<command_name >MyCommand 1</command_name>
<label >Button Label</label>
<tooltip>This is a new command.</tooltip>
<icon>\my\icons\location\icon16x16.png</icon>
<action
target="browser">
http://somewhere.com/content.jsp?partName=<!Source_file_name!>
</action>
</menu>
例: 複数の部分が選択されている場合の URL の一部の置換
この例では、ユーザーが 2 つの部分を選択すると、Featrue_Id から返った、両方の部分の getSelectedPartProperty プロパティの値が呼び出されます。その後、URL の 2 つのサブ文字列がこれらの値に置き換えられます。
<menu
ui="rmb"
view="all"
pane="all"
select="any"
visible="getSelectedCount()==2 && getSelectedPartProperty(1,'Feature_Id','featureId1') &&
getSelectedPartProperty(2,'Feature_Id','featureId2')">
<command_name >MyCommand 2</command_name>
<label >Button Label</label>
<action
target="browser">
http://www.somewhere.com/index.jsp?Id1=<!featureId1!>&Id2=<!featureId2!>
</action>
</menu>