如何修改自定义 Confluence 页面,使其像默认选项一样可见



我正在执行在我的Confluence设置中添加自定义选项卡的任务。我选择了"先进"地区作为实现这一目标的有利地点。所以我点击空间名称。然后我转到"浏览>>高级"并查看此 http://imageshack.us/f/405/advanc.png。我们在此图像中看到的"高速公路项目创建"选项卡是我自定义添加的。我写了这门课

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 插件.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>

下面看到的是虚拟机

<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/

嗯,这已经足够好了。但是我想在侧边栏旁边的"身体区域"中看到此页面。例如,如果我们单击"空间管理员"选项卡,然后单击侧栏中的"编辑空间标签";我们在标记为 http://imageshack.us/f/809/bodyarea.png/的"正文区域"中看到结果页面。

想了解一下如何实现这一目标吗?

谢谢

一个

请尝试这个

##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>

最新更新