使用場景:
在confluence中一鍵創建定製頁面,包含兩級頁面,每個頁面的內容有固定格式,這些頁面用作某類文檔的模板。
現狀:
confluence原生功能就支持自定義模板實現定製,然而無法實現多級頁面自動生成。
方案:
基本思路
使用插件增加一種blueprint(藍圖),該blueprint出現的“創建”的dialog中;
用戶可以根據blueprint的提示完成文檔模板的創建;
blueprint根據xml模板生成內容,xml支持參數化設置。
具體實現
官方示例:
網上找的升級版示例:
標題 | URL | 實用性 |
hello-blueprint |
https://bitbucket.org/atlassian/hello-blueprint/src/master/
|
|
其他輔助資料:
https://developer.atlassian.com/server/confluence/blueprint-module/
https://developer.atlassian.com/server/confluence/content-template-module/
confluence-create-content plugin的jar包、源碼下載地址
https://packages.atlassian.com/maven-public/com/atlassian/confluence/plugins/
實際過程:
space-blueprint可以使用多級模板,直接創建子頁面。
但是blueprint無法使用,因此不能通過blueprint直接創建子頁面,最後在onBlueprintCreateEvent中通過Java代碼添加的子頁面。