Author: rob.stryker(a)jboss.com
Date: 2011-10-12 23:06:26 -0400 (Wed, 12 Oct 2011)
New Revision: 35594
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
Log:
JBIDE-9793 -methods got removed somehow?
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-13
01:37:31 UTC (rev 35593)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-13
03:06:26 UTC (rev 35594)
@@ -23,6 +23,8 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.egit.core.op.CloneOperation;
import org.eclipse.egit.core.op.ConnectProviderOperation;
import org.eclipse.egit.ui.Activator;
@@ -39,11 +41,16 @@
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.merge.MergeStrategy;
import org.eclipse.jgit.transport.URIish;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.IUser;
import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
import
org.jboss.tools.openshift.express.internal.ui.wizard.projectimport.GeneralProjectImportOperation;
import
org.jboss.tools.openshift.express.internal.ui.wizard.projectimport.MavenProjectImportOperation;
@@ -147,6 +154,24 @@
private void createServerAdapterIfRequired() {
// TODO
+ Boolean b = (Boolean)getProperty(AdapterWizardPageModel.CREATE_SERVER);
+ if( b != null && b.booleanValue() ) {
+ IServerType type = (IServerType)getProperty(AdapterWizardPageModel.SERVER_TYPE);
+ IRuntime rt = (IRuntime)getProperty(AdapterWizardPageModel.RUNTIME_DELEGATE);
+ String mode = (String)getProperty(AdapterWizardPageModel.MODE);
+
+ try {
+ IServer server = ExpressServerUtils.createServer(rt, type, "Openshift
Server1");
+ ExpressServerUtils.fillServerWithOpenshiftDetails(server,
getApplication().getApplicationUrl(),
+ getUser().getRhlogin(), getUser().getPassword(),
+ getUser().getDomain().getRhcDomain(), getApplication().getName(), mode);
+ } catch(CoreException ce) {
+ OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
+ } catch( OpenshiftException ose) {
+ IStatus s = new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, "Cannot
create openshift server adapter", ose);
+ OpenshiftUIActivator.getDefault().getLog().log(s);
+ }
+ }
}
private Git createGit(File repositoryFile) throws IOException {
Show replies by date