Search in sources :

Example 1 with ContainerType

use of com.centurylink.mdw.plugin.project.model.ServerSettings.ContainerType in project mdw-designer by CenturyLinkCloud.

the class ServiceMixSettingsPage method initValues.

@Override
public void initValues() {
    super.initValues();
    ContainerType type = ServerSettings.getContainerTypeFromClass(this.getClass().getSimpleName());
    String prevServerCmdPort = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_CMD_PORT);
    if (prevServerCmdPort.length() > 0) {
        try {
            getServerSettings().setCommandPort(Integer.parseInt(prevServerCmdPort));
        } catch (NumberFormatException ex) {
            MdwPlugin.setStringPref(type + "-" + ProjectPersist.MDW_SERVER_CMD_PORT, String.valueOf(getDefaultServerSshPort()));
        }
    } else {
        getServerSettings().setCommandPort(getDefaultServerSshPort());
    }
    serverSshPortTextField.setText(String.valueOf(getServerSettings().getCommandPort()));
    OsgiSettings osgiSettings = new OsgiSettings();
    getProject().setOsgiSettings(osgiSettings);
    if (getProject().checkRequiredVersion(5, 5)) {
        gradleRadioButton.setEnabled(true);
        osgiSettings.setGradleBuild(true);
    } else {
        gradleRadioButton.setEnabled(false);
    }
    gradleRadioButton.setSelection(osgiSettings.isGradleBuild());
    mavenRadioButton.setSelection(!osgiSettings.isGradleBuild());
    osgiSettings.setGroupId(getProject().getDefaultSourceCodePackage());
    groupIdTextField.setText(osgiSettings.getGroupId());
    osgiSettings.setArtifactId(getProject().getSourceProjectName().toLowerCase());
    artifactIdTextField.setText(osgiSettings.getArtifactId());
}
Also used : OsgiSettings(com.centurylink.mdw.plugin.project.model.OsgiSettings) ContainerType(com.centurylink.mdw.plugin.project.model.ServerSettings.ContainerType)

Example 2 with ContainerType

use of com.centurylink.mdw.plugin.project.model.ServerSettings.ContainerType in project mdw-designer by CenturyLinkCloud.

the class ServerSettingsPage method initValues.

public void initValues() {
    configurator = ServerConfigurator.Factory.create(getServerSettings());
    ContainerType type = ServerSettings.getContainerTypeFromClass(this.getClass().getSimpleName());
    if (type != null) {
        String prevServerHome = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_HOME);
        if (prevServerHome.length() > 0)
            getServerSettings().setHome(prevServerHome);
        if (getServerSettings().getHome() != null)
            serverHomeTextField.setText(getServerSettings().getHome());
        if (getServerSettings().isServiceMix())
            getServerSettings().setContainerVersion("4.4.1");
        if (getServerSettings().isFuse())
            getServerSettings().setContainerVersion("6.1.0");
        String prevJdkHome = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_JDK_HOME);
        if (prevJdkHome.length() > 0)
            getServerSettings().setJdkHome(prevJdkHome);
        if (getServerSettings().getJdkHome() != null)
            jdkHomeTextField.setText(getServerSettings().getJdkHome());
        String prevServerHost = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_HOST);
        if (prevServerHost.length() > 0 && getProject().isRemote())
            getServerSettings().setHost(prevServerHost);
        else
            getServerSettings().setHost(ServerSettings.DEFAULT_HOST);
        serverHostTextField.setText(getServerSettings().getHost());
        String prevServerPort = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_PORT);
        if (prevServerPort.length() > 0 && getProject().isRemote()) {
            try {
                getServerSettings().setPort(Integer.parseInt(prevServerPort));
            } catch (NumberFormatException ex) {
                MdwPlugin.setStringPref(type + "-" + ProjectPersist.MDW_SERVER_PORT, String.valueOf(getDefaultServerPort()));
            }
        } else {
            getServerSettings().setPort(getDefaultServerPort());
        }
        serverPortTextField.setText(String.valueOf(getServerSettings().getPort()));
        String prevServerUser = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_USER);
        if (prevServerUser.length() > 0)
            getServerSettings().setUser(prevServerUser);
        else
            getServerSettings().setUser(getDefaultServerUser());
        serverUserTextField.setText(getServerSettings().getUser());
    }
    if (!getProject().checkRequiredVersion(5, 0)) {
        IProjectFacetVersion pfv = ProjectFacetsManager.getProjectFacet("mdw.workflow").getVersion("1.1");
        IFacetedProjectWorkingCopy wc = ((ModifyFacetedProjectWizard) getWizard()).getFacetedProjectWorkingCopy();
        wc.changeProjectFacetVersion(pfv);
    }
}
Also used : IProjectFacetVersion(org.eclipse.wst.common.project.facet.core.IProjectFacetVersion) ContainerType(com.centurylink.mdw.plugin.project.model.ServerSettings.ContainerType) ModifyFacetedProjectWizard(org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard) IFacetedProjectWorkingCopy(org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy)

Example 3 with ContainerType

use of com.centurylink.mdw.plugin.project.model.ServerSettings.ContainerType in project mdw-designer by CenturyLinkCloud.

the class WorkflowProjectPage method isValidContainerBasedOnVersion.

private boolean isValidContainerBasedOnVersion() {
    ContainerType container = getProject().getServerSettings().getContainerType();
    if (container == null)
        return false;
    String mdwVersion = getProject().getMdwVersion();
    if (mdwVersion == null || mdwVersion.isEmpty())
        return false;
    if (getProject().checkRequiredVersion(5, 5)) {
        if (container == ContainerType.WebLogic && getWizard() instanceof LocalCloudProjectWizard)
            return false;
    } else {
        if (container == ContainerType.Fuse || container == ContainerType.Tomcat)
            return false;
    }
    return true;
}
Also used : ContainerType(com.centurylink.mdw.plugin.project.model.ServerSettings.ContainerType)

Aggregations

ContainerType (com.centurylink.mdw.plugin.project.model.ServerSettings.ContainerType)3 OsgiSettings (com.centurylink.mdw.plugin.project.model.OsgiSettings)1 IFacetedProjectWorkingCopy (org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy)1 IProjectFacetVersion (org.eclipse.wst.common.project.facet.core.IProjectFacetVersion)1 ModifyFacetedProjectWizard (org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard)1