mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Mantis integration: Reset repository configuration on Axis errors
This commit is contained in:
@@ -151,11 +151,12 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
return new CancellableConnection() {
|
||||
@Override
|
||||
protected void doTest() throws Exception {
|
||||
myProjects = null;
|
||||
try {
|
||||
createSoap().mc_enum_access_levels(getUsername(), getPassword());
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw wrapException(e);
|
||||
throw handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +220,7 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
myProjects = projects;
|
||||
}
|
||||
|
||||
private static boolean checkAllProjectsAvailable(MantisConnectPortType soap) throws Exception {
|
||||
private boolean checkAllProjectsAvailable(MantisConnectPortType soap) throws Exception {
|
||||
// Check whether All Projects is available supported by server
|
||||
try {
|
||||
String version = soap.mc_version();
|
||||
@@ -230,12 +231,13 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
return available;
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw wrapException(e);
|
||||
throw handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static Exception wrapException(@NotNull Exception e) throws Exception {
|
||||
private Exception handleException(@NotNull Exception e) throws Exception {
|
||||
if (e instanceof AxisFault) {
|
||||
resetConfiguration();
|
||||
throw new Exception(TaskBundle.message("failure.server.message", ((AxisFault)e).getFaultString()), e);
|
||||
}
|
||||
throw e;
|
||||
@@ -268,7 +270,7 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
return soap.mc_issue_get(getUsername(), getPassword(), BigInteger.valueOf(Integer.valueOf(id)));
|
||||
}
|
||||
catch (RemoteException e) {
|
||||
throw wrapException(e);
|
||||
throw handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +280,7 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
return soap.mc_projects_get_user_accessible(getUsername(), getPassword());
|
||||
}
|
||||
catch (RemoteException e) {
|
||||
throw wrapException(e);
|
||||
throw handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +290,7 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
return soap.mc_filter_get(getUsername(), getPassword(), BigInteger.valueOf(project.getId()));
|
||||
}
|
||||
catch (RemoteException e) {
|
||||
throw wrapException(e);
|
||||
throw handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,10 +310,29 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
}
|
||||
}
|
||||
catch (RemoteException e) {
|
||||
throw wrapException(e);
|
||||
throw handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void resetConfiguration() {
|
||||
if (myProjects != null) {
|
||||
for (MantisProject project : myProjects) {
|
||||
if (project.isUnspecified()) {
|
||||
myCurrentProject = project;
|
||||
for (MantisFilter filter : project.getFilters()) {
|
||||
if (filter.isUnspecified()) {
|
||||
myCurrentFilter = filter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
myCurrentProject = null;
|
||||
myCurrentFilter = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public MantisProject getCurrentProject() {
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.List;
|
||||
/**
|
||||
* @author Mikhail Golubev
|
||||
* @author evgeny.zakrevsky
|
||||
* Date: 9/21/12
|
||||
* Date: 9/21/12
|
||||
*/
|
||||
public class MantisRepositoryEditor extends BaseRepositoryEditor<MantisRepository> {
|
||||
private ComboBox myProjectCombobox;
|
||||
@@ -105,6 +105,10 @@ public class MantisRepositoryEditor extends BaseRepositoryEditor<MantisRepositor
|
||||
if (connectionSuccessful) {
|
||||
new FetchMantisProjects().queue();
|
||||
}
|
||||
else {
|
||||
myProjectCombobox.removeAllItems();
|
||||
myFilterCombobox.removeAllItems();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user