Skip to content

Commit

Permalink
TEIIDDES-1469: Rename readlURLProperty
Browse files Browse the repository at this point in the history
* ConnecitonInfoHelper
 * The property being read is the end point rather than URL so refactors
   the method appropriately
  • Loading branch information
Paul Richardson committed Aug 29, 2012
1 parent a17fd49 commit df71ffd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package org.teiid.designer.datatools.profiles.ws;

import java.util.Properties;

import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ui.wizards.ProfileDetailsPropertyPage;
import org.eclipse.datatools.help.ContextProviderDelegate;
Expand Down Expand Up @@ -234,7 +233,7 @@ private void initControls() {
if (null != props.get(ICredentialsCommon.PASSWORD_PROP_ID)) {
passwordText.setText((String)props.get(ICredentialsCommon.PASSWORD_PROP_ID));
}
String url = ConnectionInfoHelper.readURLProperty(props);
String url = ConnectionInfoHelper.readEndPointProperty(props);
if (null != url) {
urlText.setText(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void initControls() {
IConnectionProfile profile = getConnectionProfile();
Properties props = profile.getBaseProperties();

String url = ConnectionInfoHelper.readURLProperty(props);
String url = ConnectionInfoHelper.readEndPointProperty(props);
if (null != url) {
urlText.setText(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Collection;
import java.util.Properties;
import java.util.Set;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
Expand Down Expand Up @@ -413,13 +412,13 @@ public void clearConnectionInfo(ModelResource modelResource) throws ModelWorkspa
* @param properties
* @return 'endpoint' property value
*/
public static String readURLProperty(Properties properties) {
String urlPropId = properties.getProperty(IWSProfileConstants.END_POINT_URI_PROP_ID);
if (urlPropId == null) {
// Check for the legacy version that was getting used by the WSDL importer in 7.7.1
urlPropId = properties.getProperty(IWSProfileConstants.WSDL_URI_PROP_ID);
public static String readEndPointProperty(Properties properties) {
String endPointPropId = properties.getProperty(IWSProfileConstants.END_POINT_URI_PROP_ID);
if (endPointPropId == null) {
// Check for the incorrect version that was getting used by the WSDL importer in 7.7.1
endPointPropId = properties.getProperty(IWSProfileConstants.WSDL_URI_PROP_ID);
}

return urlPropId;
return endPointPropId;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.teiid.designer.datatools.profiles.ws;

import java.util.Properties;

import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.teiid.designer.core.workspace.ModelResource;
import org.teiid.designer.core.workspace.ModelWorkspaceException;
Expand All @@ -24,7 +23,7 @@ public void setConnectionInfo(ModelResource modelResource,

Properties props = connectionProfile.getBaseProperties();

String url = readURLProperty(props);
String url = readEndPointProperty(props);
if (null != url) {
connectionProps.setProperty(CONNECTION_NAMESPACE + IWSProfileConstants.END_POINT_URI_PROP_ID, url);
}
Expand Down Expand Up @@ -78,7 +77,7 @@ public Properties getTeiidRelatedProperties(
connectionProps.setProperty(ICredentialsCommon.PASSWORD_PROP_ID, password);
}

String url = readURLProperty(props);
String url = readEndPointProperty(props);
if (null != url) {
connectionProps.setProperty(IWSProfileConstants.END_POINT_URI_PROP_ID, url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void setConnectionProfile(IConnectionProfile connectionProfile) {
String password = props.getProperty(ICredentialsCommon.PASSWORD_PROP_ID);
setWSDLCredentials(securityTypeValue, userName, password);

String fileUri = ConnectionInfoHelper.readURLProperty(props);
String fileUri = ConnectionInfoHelper.readEndPointProperty(props);
if( fileUri != null ) {
setWSDLFileUri(fileUri);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Properties;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
Expand Down Expand Up @@ -458,7 +457,7 @@ private void refreshUiFromManager() {
return;
}
Properties props = profile.getBaseProperties();
wsdlURIText.setText(ConnectionInfoHelper.readURLProperty(props));
wsdlURIText.setText(ConnectionInfoHelper.readEndPointProperty(props));
updateWidgetEnablements();
setErrorMessage(null);
setMessage(Messages.WsdlDefinitionPage_select_profile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ private void loadFileListViewer() {

private File getXmlFileFromRestUrl(IConnectionProfile profile) {
Properties props = profile.getBaseProperties();
String endpoint = ConnectionInfoHelper.readURLProperty(props);
String endpoint = ConnectionInfoHelper.readEndPointProperty(props);
String username = (String) props.get(ICredentialsCommon.USERNAME_PROP_ID);
String password = (String) props.get(ICredentialsCommon.PASSWORD_PROP_ID);
File xmlFile = null;
Expand Down Expand Up @@ -720,7 +720,7 @@ private String getUrlStringForConnectionProfile() {
if (getConnectionProfile() != null) {
Properties props = getConnectionProfile().getBaseProperties();
if(isRestConnectionProfile()) {
String fileListValue = ConnectionInfoHelper.readURLProperty(props);
String fileListValue = ConnectionInfoHelper.readEndPointProperty(props);
if (fileListValue != null) {
return fileListValue;
}
Expand Down

0 comments on commit df71ffd

Please sign in to comment.