2016-06-14 18:43:39 +02:00
|
|
|
package org.gcube.portlets.widgets.githubconnector.client;
|
|
|
|
|
|
|
|
import org.gcube.portlets.widgets.githubconnector.client.wizard.WizardWindow;
|
2016-06-15 18:25:04 +02:00
|
|
|
import org.gcube.portlets.widgets.githubconnector.shared.git.GitHubCloneSession;
|
|
|
|
|
2016-06-14 18:43:39 +02:00
|
|
|
import com.google.gwt.core.client.GWT;
|
2016-06-15 18:25:04 +02:00
|
|
|
import com.google.gwt.user.client.Timer;
|
2016-06-14 18:43:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2017-05-12 17:38:47 +02:00
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
2016-06-14 18:43:39 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class GitHubConnectorWizard extends WizardWindow {
|
|
|
|
|
2016-06-15 18:25:04 +02:00
|
|
|
private GitHubCloneSession gitHubCloneSession;
|
|
|
|
|
|
|
|
public GitHubConnectorWizard(String destinationFolderId) {
|
2016-06-14 18:43:39 +02:00
|
|
|
super("GitHub Connector");
|
2016-06-15 18:25:04 +02:00
|
|
|
GWT.log("GitHubConnectorWizard: " + destinationFolderId);
|
|
|
|
checkSession();
|
|
|
|
gitHubCloneSession = new GitHubCloneSession(destinationFolderId);
|
2016-06-14 18:43:39 +02:00
|
|
|
create();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void create() {
|
|
|
|
GitHubConnectorCredentialCard CredentialCard = new GitHubConnectorCredentialCard();
|
|
|
|
addCard(CredentialCard);
|
|
|
|
CredentialCard.setup();
|
|
|
|
|
|
|
|
}
|
2016-06-15 18:25:04 +02:00
|
|
|
|
|
|
|
public GitHubCloneSession getGitHubCloneSession() {
|
|
|
|
return gitHubCloneSession;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void checkSession() {
|
|
|
|
// if you do not need to something when the session expire
|
2016-11-24 15:52:28 +01:00
|
|
|
//CheckSession.getInstance().startPolling();
|
2016-06-15 18:25:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private void sessionExpiredShow() {
|
2016-11-24 15:52:28 +01:00
|
|
|
//CheckSession.showLogoutDialog();
|
2016-06-15 18:25:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void sessionExpiredShowDelayed() {
|
|
|
|
Timer timeoutTimer = new Timer() {
|
|
|
|
public void run() {
|
|
|
|
sessionExpiredShow();
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
int TIMEOUT = 3; // 3 second timeout
|
|
|
|
|
|
|
|
timeoutTimer.schedule(TIMEOUT * 1000); // timeout is in milliseconds
|
|
|
|
}
|
2016-06-30 18:05:17 +02:00
|
|
|
|
2016-06-15 18:25:04 +02:00
|
|
|
|
|
|
|
|
2016-06-14 18:43:39 +02:00
|
|
|
}
|