myUrl = WicketUtils.getGitblitURL(getRequest());
destinationUrl = "https://";
// temporary proposal
FederationProposal proposal = app().federation().createFederationProposal(myUrl, token);
if (proposal == null) {
error(getString("gb.couldNotCreateFederationProposal"), true);
}
CompoundPropertyModel<SendProposalPage> model = new CompoundPropertyModel<SendProposalPage>(
this);
Form<SendProposalPage> form = new Form<SendProposalPage>("editForm", model) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit() {
// confirm a repository name was entered
if (StringUtils.isEmpty(myUrl)) {
error(getString("gb.pleaseSetGitblitUrl"));
return;
}
if (StringUtils.isEmpty(destinationUrl)) {
error(getString("gb.pleaseSetDestinationUrl"));
return;
}
// build new proposal
FederationProposal proposal = app().federation().createFederationProposal(myUrl, token);
proposal.url = myUrl;
proposal.message = message;
try {
FederationProposalResult res = FederationUtils
.propose(destinationUrl, proposal);