use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class RenderTransformationDialog method populateFunctionList.
/**
* Populate function list.
*
* @param selectedItem the selected item
*/
private void populateFunctionList(String selectedItem) {
GeoServerConnection connection = connectionMap.get(selectedItem);
String message = String.format("%s : %s", Localisation.getString(RenderTransformationDialog.class, "RenderTransformationDialog.tryingToConnect"), connection.getUrl().toString());
showMessage(message, false);
// Make sure the above messages are displayed by trying to connect to
// a WPS server in a separate thread.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
client = new GeoServerWPSClient(connection);
if (client.getCapabilities()) {
availableFunctionList = client.getRenderTransformations(DataTypeEnum.E_VECTOR);
functionListModel.removeAllElements();
populateBuiltInProcessFunctions();
for (ProcessBriefType function : availableFunctionList) {
functionListModel.addElement(function.getIdentifier().getValue());
}
// Clear info field
showMessage("", false);
} else {
// Show error message
showMessage(Localisation.getString(RenderTransformationDialog.class, "RenderTransformationDialog.errorFailedToConnect"), true);
}
// Make ui available again
updateButtonState(true);
}
});
}
use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class RenderTransformationDialog method main.
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
GeoServerConnectionManagerInterface dummyInterface = new GeoServerConnectionManagerInterface() {
@Override
public List<GeoServerConnection> getConnectionList() {
List<GeoServerConnection> list = new ArrayList<GeoServerConnection>();
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("Test");
try {
connection.setUrl(new URL("http://localhost:8080/geoserver"));
connection.setUserName("admin");
connection.setPassword("geoserver");
list.add(connection);
} catch (MalformedURLException e) {
e.printStackTrace();
}
return list;
}
@Override
public void updateList() {
}
@Override
public GeoServerConnection getConnection(String connectionDataName) {
return null;
}
@Override
public void readPropertyFile(GeoServerReadProgress progress) {
}
@Override
public Map<GeoServerConnection, GeoServerClientInterface> getConnectionMap() {
return null;
}
@Override
public void removeConnection(GeoServerConnection connection) {
}
@Override
public void addNewConnection(GeoServerReadProgress progress, GeoServerConnection newConnectionDetails) {
}
};
List<VersionData> vendorOptionList = new ArrayList<VersionData>();
vendorOptionList.add(VersionData.getLatestVersion(GeoServerVendorOption.class));
VendorOptionManager.getInstance().setSelectedVendorOptions(vendorOptionList);
RenderTransformationDialog dlg = new RenderTransformationDialog(dummyInterface);
dlg.showDialog(null);
}
use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class RenderTransformationDialog method populateConnectionComboBox.
/**
* Populate connection combo box.
*/
private void populateConnectionComboBox() {
connectionComboBox.removeAllItems();
if (geoServerConnectionManager != null) {
List<GeoServerConnection> connectionList = geoServerConnectionManager.getConnectionList();
for (GeoServerConnection connection : connectionList) {
connectionComboBox.addItem(connection.getConnectionName());
connectionMap.put(connection.getConnectionName(), connection);
}
}
}
use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class ConnectorDetailsPanel method getConnectionDetails.
/**
* Gets the connection details.
*
* @return the connection details
*/
private GeoServerConnection getConnectionDetails() {
GeoServerConnection newConnectionDetails = new GeoServerConnection();
newConnectionDetails.setConnectionName(textFieldName.getText());
newConnectionDetails.setUserName(textFieldUsername.getText());
URL url = null;
try {
url = new URL(textFieldURL.getText());
} catch (MalformedURLException e) {
// Do nothing
}
newConnectionDetails.setUrl(url);
newConnectionDetails.setPassword(new String(textFieldPassword.getPassword()));
return newConnectionDetails;
}
use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class GeoServerConnectionTest method testGetUserName.
/**
* Test method for {@link com.sldeditor.common.data.GeoServerConnection#getUserName()}.
* Test method for {@link com.sldeditor.common.data.GeoServerConnection#setUserName(java.lang.String)}.
*/
@Test
public void testGetUserName() {
GeoServerConnection connection = new GeoServerConnection();
String userName = "test user name";
connection.setUserName(userName);
assertEquals(connection.getUserName(), userName);
}
Aggregations