use of nl.tudelft.watchdog.core.ui.wizards.User in project watchdog by TestRoots.
the class UserRegistrationPage method makeRegistration.
protected void makeRegistration() {
User user = new User();
user.email = getEmailInput().getText();
user.organization = getOrganizationInput().getText();
user.mayContactUser = getMayContactUser();
user.programmingExperience = getProgrammingExperience();
user.operatingSystem = Platform.getOS();
try {
id = new JsonTransferer().registerNewUser(user);
} catch (ServerCommunicationException exception) {
successfulRegistration = false;
messageTitle = "Problem creating new user!";
messageBody = WordUtils.wrap(exception.getMessage(), 100, null, true);
messageBody += "\nAre you connected to the internet, and is port 80 open?";
messageBody += "\nPlease contact us via www.testroots.org. \nWe'll troubleshoot the issue!";
return;
}
successfulRegistration = true;
((UserProjectRegistrationWizard) getWizard()).userid = id;
messageTitle = "New user registered!";
messageBody = "Your new user id is registered: ";
Preferences preferences = Preferences.getInstance();
preferences.setUserId(id);
preferences.registerProjectId(WatchDogUtils.getWorkspaceName(), "");
preferences.setProgrammingExperience(user.programmingExperience);
}
use of nl.tudelft.watchdog.core.ui.wizards.User in project watchdog by TestRoots.
the class StartupUIThread method makeSilentRegistration.
private void makeSilentRegistration() {
String userId = "";
if (preferences.getUserId() == null || preferences.getUserId().isEmpty()) {
User user = new User();
user.programmingExperience = "NA";
try {
userId = new JsonTransferer().registerNewUser(user);
} catch (ServerCommunicationException exception) {
WatchDogLogger.getInstance().logSevere(exception);
}
if (WatchDogUtils.isEmptyOrHasOnlyWhitespaces(userId)) {
return;
}
preferences.setUserId(userId);
preferences.registerProjectId(WatchDogUtils.getWorkspaceName(), "");
}
savePreferenceStoreIfNeeded();
registerAnonymousProject(preferences.getUserId());
}
use of nl.tudelft.watchdog.core.ui.wizards.User in project watchdog by TestRoots.
the class JsonConverterTestBase method testUserHasWatchDogVersion.
@Test
public void testUserHasWatchDogVersion() {
String gsonRepresentation = WatchDogUtils.convertToJson(new User());
boolean containsWDVersion = gsonRepresentation.contains("\"wdv\":\"" + WatchDogGlobals.CLIENT_VERSION + "\"");
assertTrue(containsWDVersion);
}
use of nl.tudelft.watchdog.core.ui.wizards.User in project watchdog by TestRoots.
the class WatchDogStartUp method makeSilentRegistration.
private void makeSilentRegistration() {
String userId = "";
Preferences preferences = Preferences.getInstance();
if (preferences.getUserId() == null || preferences.getUserId().isEmpty()) {
User user = new User();
user.programmingExperience = "NA";
try {
userId = new JsonTransferer().registerNewUser(user);
} catch (ServerCommunicationException exception) {
WatchDogLogger.getInstance().logSevere(exception);
}
if (WatchDogUtils.isEmptyOrHasOnlyWhitespaces(userId)) {
return;
}
preferences.setUserId(userId);
preferences.registerProjectId(WatchDogUtils.getProjectName(), "");
}
registerAnonymousProject(preferences.getUserId());
}
use of nl.tudelft.watchdog.core.ui.wizards.User in project watchdog by TestRoots.
the class UserRegistrationStep method makeRegistration.
protected void makeRegistration() {
User user = new User();
user.email = getEmailInput().getText();
user.organization = getOrganizationInput().getText();
user.mayContactUser = getMayContactUser();
user.programmingExperience = getProgrammingExperience();
user.operatingSystem = System.getProperty("os.name");
try {
id = new JsonTransferer().registerNewUser(user);
} catch (ServerCommunicationException exception) {
successfulRegistration = false;
messageTitle = "Problem creating new user!";
messageBody = "<html>" + WordUtils.wrap(exception.getMessage(), 100, "<br>", true);
messageBody += "<br>Are you connected to the internet, and is port 80 open?";
messageBody += "<br>Please contact us via www.testroots.org. <br>We'll troubleshoot the issue!</html>";
return;
}
successfulRegistration = true;
((UserProjectRegistrationWizard) getWizard()).userid = id;
messageTitle = "New user registered!";
messageBody = "Your new user id is registered: ";
Preferences preferences = Preferences.getInstance();
preferences.setUserId(id);
preferences.registerProjectId(WatchDogUtils.getProjectName(), "");
preferences.setProgrammingExperience(user.programmingExperience);
}
Aggregations