use of cz.metacentrum.perun.webgui.json.registrarManager.CreateApplication in project perun by CESNET.
the class ApplicationFormPage method sendForm.
/**
* Send form
*/
protected void sendForm(final CustomButton button) {
PerunPrincipal pp = session.getPerunPrincipal();
// fed info
String fedInfo = "";
fedInfo += "{";
fedInfo += " displayName=\"" + pp.getAdditionInformations("displayName") + "\"";
fedInfo += " commonName=\"" + pp.getAdditionInformations("cn") + "\"";
fedInfo += " givenName=\"" + pp.getAdditionInformations("givenName") + "\"";
fedInfo += " sureName=\"" + pp.getAdditionInformations("sn") + "\"";
fedInfo += " loa=\"" + pp.getAdditionInformations("loa") + "\"";
fedInfo += " mail=\"" + pp.getAdditionInformations("mail") + "\"";
fedInfo += " organization=\"" + pp.getAdditionInformations("o") + "\"";
fedInfo += " }";
Application app = Application.construct(vo, group, type, fedInfo, pp.getActor(), pp.getExtSource(), pp.getExtSourceType(), pp.getExtSourceLoa());
if (session.getUser() != null) {
// set user association if known from perun
app.setUser(session.getUser());
}
// loading
final PopupPanel loadingBox = session.getUiElements().perunLoadingBox(ApplicationMessages.INSTANCE.processing());
// Create application request
CreateApplication ca = new CreateApplication(JsonCallbackEvents.disableButtonEvents(button, new JsonCallbackEvents() {
@Override
public void onLoadingStart() {
// show loading box
loadingBox.show();
}
@Override
public void onFinished(JavaScriptObject jso) {
loadingBox.hide();
formOk(jso);
}
@Override
public void onError(PerunError err) {
loadingBox.hide();
formError(err);
}
}));
// Send the request
ca.createApplication(app, data);
}
Aggregations