More Related Content
Similar to [Alfresco]ドキュメントライブラリのUIカスタマイズ
Similar to [Alfresco]ドキュメントライブラリのUIカスタマイズ (20)
More from Jun Terashita (6)
[Alfresco]ドキュメントライブラリのUIカスタマイズ
- 2. 目次
1. 自己紹介
2. ドキュメントライブラリのアクションメニューのカスタマイズ方法
3. (デモ)ドキュメントライブラリのアクションメニューのカスタマイズ
4. ドキュメントライブラリのソートキーのカスタマイズ方法
5. (デモ)ドキュメントライブラリのソートキーのカスタマイズ
2
- 3. 自己紹介
aegif で主にAlfrescoまわりのコンサルタントをやっています。
生後2ヶ月の息子がかわいくて仕方がない。
ドラクエXをやるべきかどうか迷っているうちに2ヶ月経過してしまった。
3
- 5. ドキュメントライブラリのアクションメニュー
ファイル、フォルダ、リンクの
それぞれに対して、
この2つがあるので3×2で計6種類
よくある要件
不要なアクションメニューは隠蔽したい。
よく使うメニューを上の方に(その他のアクションから出して)表示してほしい。 などなど
5
- 6. カスタマイズ方法
share-config-custom.xml に share-documentlibrary-config.xml から以下のように必要な部分をコピペして編集
<!-- Custom DocLibActions config section -->
<config evaluator="string-compare" condition="DocLibActions">
<actionGroups>
<actionGroup id="document-browse">
<action index="100" id="document-download" />
・・・
<action index="310" id="document-view-googlemaps" />
<action index="320" id="document-view-in-source-repository" />
</actionGroup>
</actionGroups>
</config>
設定内容
index はメニューの並び順を指定するために使う。
icon や label は別途それぞれのActionに定義されているが、ここで変更することもできる。
不要なものを隠ぺいする場合は replace = “true” にして設定を全て書き換える必要がある。
6
- 8. デモ1:表示順、ラベル、アイコンの変更
例えば share-config-custom.xml にこんな風に書くと・・・
<!-- Custom DocLibActions config section -->
<config evaluator="string-compare" condition="DocLibActions">
<actionGroups> indexを変えて表示順を変更
<actionGroup id="document-browse">
<action index="010" id="document-copy-to" /> labelを変更
<action index="020" id="document-move-to" />
iconを変更
<action index="030" id="document-delete" label="actions.folder.delete"/>
<action index="280" id="document-assign-workflow" icon="document-publish" />
</actionGroup>
</actionGroups>
順番が変わっている
</config>
labelが変わっている
デフォルトではこうなっていたのが・・・
こうなる。
iconが変わっている
8
- 9. デモ2:REPLACE = “TRUE” にしてみる
内容はさっきと同じで、replace = “true” にしてみると・・・
<!-- Custom DocLibActions config section -->
<config evaluator=“string-compare” condition=“DocLibActions” replace=“true”>
<actionGroups>
replace = “true” を追記
<actionGroup id="document-browse">
<action index="010" id="document-copy-to" />
<action index="020" id="document-move-to" />
<action index="030" id="document-delete" label="actions.folder.delete"/>
<action index="280" id="document-assign-workflow" icon="document-publish" />
</actionGroup>
</actionGroups>
</config>
share-config-custom.xml に
書いたものだけが表示される。
デフォルトではこうなっていたのが・・・
こうなる。
9
- 11. ドキュメントライブラリのソートキー
コンテンツをファイル名や
作成日等でソートするためのキー
よくある要件
不要なキーは隠蔽したい。
よく使うキーを上の方に表示してほしい。 などなど
11
- 12. カスタマイズ方法
share-config-custom.xml に share-documentlibrary-config.xml から以下のように必要な部分をコピペして編集
<!-- Document Library config section -->
<config evaluator="string-compare" condition="DocumentLibrary" replace="true">
<sorting>
<sort label="label.name">cm:name|true</sort>
<sort label="label.popularity">cm:likesRatingSchemeCount|false</sort>
<sort label="label.created">cm:created</sort>
<sort label="label.creator">cm:creator</sort>
<sort label="label.modified">cm:modified</sort>
<sort label="label.modifier">cm:modifier</sort>
<sort label="label.mimetype">cm:content.mimetype</sort>
</sorting>
</config>
設定内容
キーの追加のみの場合は replace = “true” は不要。
|true または |false を付けると、それぞれデフォルトで昇順、降順になる。
12
- 14. デモ:ソートキーの変更
例えば share-config-custom.xml にこんな風に書くと・・・
<!-- Document Library config section -->
「作成日」はデフォルトを
<config evaluator="string-compare" condition="DocumentLibrary" replace="true"> 降順に指定
<sorting>
<sort label="label.created">cm:created|false</sort>
<sort label="label.modified">cm:modified</sort>
不要なものを削除して
<sort label="label.creator">cm:creator</sort> 並び順を変更
<sort label="label.modifier">cm:modifier</sort>
<sort label="label.name">cm:name|true</sort>
<sort label="label.popularity">cm:likesRatingSchemeCount|false</sort>
<sort label="label.mimetype">cm:content.mimetype</sort>
「作成日」を選ぶと
</sorting> 自動的に降順になる
</config>
削除したキーがなくなり
並び順が変わっている
デフォルトではこうなっていたのが・・・ こうなる。
14