2012-07-06 235 views
1

我正在追求在我的Confluence設置中添加我的自定義選項卡的任務。我選擇了「先進」地區作爲實現這一目標的有利地點。 所以我點擊空間名稱。然後我轉到'瀏覽>>高級'並參見Thishttp://imageshack.us/f/405/advanc.png。我們在本圖中看到的「高速公路項目創建」選項卡是我自定義添加的。 我寫了這個類如何修改自定義的Confluence頁面,使其可見像默認選項

package com.atlassian.myorg; 

import com.atlassian.confluence.core.ConfluenceActionSupport; 
import com.atlassian.confluence.pages.AbstractPage; 
import com.atlassian.confluence.pages.actions.PageAware; 
import com.opensymphony.xwork.Action; 

/** 
* The simplest action possible 
    */ 
public class ExampleAction extends ConfluenceActionSupport 
{ 
    @Override 
    public String execute() throws Exception 
    { 
    return Action.SUCCESS; 
    } 

    } 

使用Atlassian的這-plugin.xml的

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"> 

<plugin-info> 
    <description>${project.description}</description> 
    <version>${project.version}</version> 
    <vendor name="${project.organization.name}" url="${project.organization.url}" /> 
</plugin-info> 

    <resource type="i18n" name="i18n" location="message" /> 
    <web-item name="add-fpc-label-action-web-ui" key="add-fpc-label-action-web-ui" section="system.space" weight="150"> 
    <description key="item.add-fpc-label-action-web-ui.link.desc">Allows the Create Freeway Project functionality.</description> 
    <label key="Freeway Project Creation"/> 
    <link linkId="add-fpc-label-action">/plugins/examples/hello.action?key=$helper.space.key</link> 
</web-item> 


    <xwork name="My Example Action" key="example-action"> 
    <description>Shows a simple "Hello, World!" Action</description> 
    <package name="examples" extends="default" namespace="/plugins/examples"> 
     <default-interceptor-ref name="validatingStack" /> 

     <action name="hello" class="com.atlassian.myorg.ExampleAction"> 
      <result name="success" type="velocity">/templates/example/hello.vm</result> 
     </action> 
    </package> 
</xwork>   
</atlassian-plugin> 

下面看到的是VM

<html> 
<head> 
    <title>This is my Example action!</title> 
    <meta name="decorator" content="atl.general" /> 
</head> 
<body> 
<strong>Hello, Confluence World!</strong> 
</body> 
</html> 

結果當我點擊此選項卡上名爲「高速公路項目創作「我看到這個頁面http://imageshack.us/f/846/imageprf.png/

那麼這個足夠好。但是我想讓這個頁面在側欄中的「body area」中看到。例如,如果我們點擊「空間管理」標籤,然後點擊側欄上的「編輯空間標籤」我們看到標記爲http://imageshack.us/f/809/bodyarea.png /的「身體區域」中產生的頁面。

想知道如何實現?

感謝

一個

回答

0

請試試這個

##requireResource("confluence.web.resources:space-admin") 
<html> 
<head> 
    <title>This is my Example action!</title> 
    <meta name="decorator" content="atl.general" /> 
</head> 

<content tag="key">$action.space.key</content> 

<body>  

#applyDecorator("root") 
    #decoratorParam("helper" $action.helper) 
    #decoratorParam("context" "space-administration") 
    #decoratorParam("mode" "view-space-administration") 

    #applyDecorator ("root") 
     #decoratorParam ("context" "spaceadminpanel") 
     #decoratorParam ("selection" "add-fpc-label-action-web-ui") 
     #decoratorParam ("title" $action.getText("action.name")) 
     #decoratorParam ("selectedTab" "admin") 
     #decoratorParam("helper" $action.helper) 

     <strong>Hello, Confluence World!</strong> 
    #end 
#end  
</body> 
</html> 
+0

嗨吉米 由於一噸的幫助和它的工作! :)這是我現在看到的用戶界面http://imageshack.us/f/137/missingtabs.png/。 但是我看到的只是我的自定義選項卡和其他選項卡,如高級,SpaceAdmin等已經消失。是否還需要添加更多內容才能將這些選項卡與我們添加的新頁面一起保留下來? – 2012-07-09 08:26:42