我正在尝试使用 atlassian-connect-play-java 制作一个简单的 HelloWorld 插件:
我的控制器:
package controllers;
import views.html.*;
import com.atlassian.connect.play.java.controllers.AcController;
import com.google.common.base.Supplier;
import play.mvc.Controller;
import play.mvc.Result;
public class Application extends Controller {
public static Result index()
{
return AcController.index(home(), descriptor());
}
private static Supplier<Result> descriptor()
{
return new Supplier<Result>()
{
@Override
public Result get()
{
return AcController.descriptor();
}
};
}
private static Supplier<Result> home()
{
return new Supplier<Result>()
{
@Override
public Result get()
{
return ok(index.render("Hello"));
}
};
}
}
我的路线文件:
GET / controllers.Application.index()
GET /assets/*file controllers.Assets.at(path="/public", file)
-> / ac.Routes
我的 index:scala.html 文件:
@(message: String)
@main("Welcome to Play") {
<p>@message</p>
}
我的 main.scala.html 文件:
@(title: String)(content: Html)
<!DOCTYPE html>
<html>
<head>
<title>@title</title>
<script src="http://localhost:1990/confluence/atlassian-connect/all.js" type="text/javascript"></script>
<link rel="stylesheet" href="//aui-cdn.atlassian.com/aui-adg/5.4.3/css/aui.css" media="all">
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
<script src="@routes.Assets.at("javascripts/jquery-1.9.0.min.js")" type="text/javascript"></script>
</head>
<body>
<div class="ac-content">
<p>@content</p>
</div>
</body>
</html>
我的 atlassian-connect.json 文件:
{
"key": "${addonKey}",
"name": "${addonName}",
"description": "Atlassian Connect add-on",
"baseUrl": "${localBaseUrl}",
"vendor": {
"name": "Atlassian",
"url": "http://www.atlassian.com"
},
"authentication": {
"type": "none"
},
"modules": {
"generalPages": [
{
"url": "/",
"key": "test-application",
"location": "system.user",
"name": {
"value": "Test"
}
}
]
},
"scopes": ["READ"]
}
运行我的播放应用程序时,一切正常。
但是,当我在本地 Confluence 实例上安装插件并启动它时,加载项的内容永远不会停止加载,我收到以下消息:
加载项没有响应。等待还是取消?
我试图找到问题,但我不能,有人可以帮忙吗?