use of cz.metacentrum.perun.webgui.model.PerunError in project perun by CESNET.
the class CreateApplicationForm method createApplicationForm.
/**
* Creating application form
*/
public void createApplicationForm() {
// test arguments
if (!this.testCreating()) {
return;
}
// new events
JsonCallbackEvents newEvents = new JsonCallbackEvents() {
public void onError(PerunError error) {
session.getUiElements().setLogErrorText("Creating application form failed.");
events.onError(error);
}
;
public void onFinished(JavaScriptObject jso) {
session.getUiElements().setLogSuccessText("Application form created.");
events.onFinished(jso);
}
;
public void onLoadingStart() {
events.onLoadingStart();
}
;
};
// sending data
JsonPostClient jspc = new JsonPostClient(newEvents);
jspc.sendData(JSON_URL, prepareJSONObject());
}
use of cz.metacentrum.perun.webgui.model.PerunError in project perun by CESNET.
the class SendPasswordResetLinkEmail method sendEmail.
/**
* Send password reset gui link to member's email
*
* @param member
*/
public void sendEmail(final RichMember member, String namespace) {
this.member = member;
this.namespace = namespace;
// test arguments
if (!this.testAdding()) {
return;
}
// new events
JsonCallbackEvents newEvents = new JsonCallbackEvents() {
public void onError(PerunError error) {
events.onError(error);
}
public void onFinished(JavaScriptObject jso) {
events.onFinished(jso);
}
public void onLoadingStart() {
events.onLoadingStart();
}
};
// sending data
JsonPostClient jspc = new JsonPostClient(newEvents);
jspc.sendData(JSON_URL, prepareJSONObject());
}
use of cz.metacentrum.perun.webgui.model.PerunError in project perun by CESNET.
the class ValidateMemberAsync method validateMemberAsync.
/**
* Attempts to create member in VO from candidate
*
* @param member
*
*/
public void validateMemberAsync(final Member member) {
this.member = member;
// test arguments
if (!this.testAdding()) {
return;
}
// new events
JsonCallbackEvents newEvents = new JsonCallbackEvents() {
public void onError(PerunError error) {
session.getUiElements().setLogErrorText("Validating member: " + member.getId() + " failed.");
events.onError(error);
}
;
public void onFinished(JavaScriptObject jso) {
session.getUiElements().setLogSuccessText("Member " + member.getId() + " validated !");
events.onFinished(jso);
}
;
public void onLoadingStart() {
events.onLoadingStart();
}
;
};
// sending data
JsonPostClient jspc = new JsonPostClient(newEvents);
jspc.setHidden(hidden);
jspc.sendData(JSON_URL, prepareJSONObject());
}
use of cz.metacentrum.perun.webgui.model.PerunError in project perun by CESNET.
the class CreateOwner method createOwner.
/**
* Attempts to create owner, it first tests the values and then submits them.
*
* @param ownerName name of future owner
* @param ownerContact owners contact (mail, phone, vo etc.)
* @param ownerType type of owner (administrative, technical)
*/
public void createOwner(final String ownerName, final String ownerContact, final String ownerType) {
this.ownerName = ownerName;
this.ownerContact = ownerContact;
this.ownerType = ownerType;
// test arguments
if (!this.testCreating()) {
return;
}
// new events
JsonCallbackEvents newEvents = new JsonCallbackEvents() {
public void onError(PerunError error) {
session.getUiElements().setLogErrorText("Creating owner: " + ownerName + " failed.");
events.onError(error);
}
;
public void onFinished(JavaScriptObject jso) {
session.getUiElements().setLogSuccessText("Owner " + ownerName + " created.");
events.onFinished(jso);
}
;
public void onLoadingStart() {
events.onLoadingStart();
}
;
};
// sending data
JsonPostClient jspc = new JsonPostClient(newEvents);
jspc.sendData(JSON_URL, prepareJSONObject());
}
use of cz.metacentrum.perun.webgui.model.PerunError in project perun by CESNET.
the class DeleteOwner method deleteOwner.
/**
* Attempts to delete owner, it first tests the values and then submits them.
*
* @param ownerId ID of owner to be deleted
*/
public void deleteOwner(final int ownerId) {
this.ownerId = ownerId;
// test arguments
if (!this.testDeleting()) {
return;
}
// new events
JsonCallbackEvents newEvents = new JsonCallbackEvents() {
public void onError(PerunError error) {
session.getUiElements().setLogErrorText("Deleting Owner: " + ownerId + " failed.");
events.onError(error);
}
;
public void onFinished(JavaScriptObject jso) {
session.getUiElements().setLogSuccessText("Owner " + ownerId + " deleted.");
events.onFinished(jso);
}
;
public void onLoadingStart() {
events.onLoadingStart();
}
;
};
// sending data
JsonPostClient jspc = new JsonPostClient(newEvents);
jspc.sendData(JSON_URL, prepareJSONObject());
}
Aggregations