alerts) {
for (Severity s : Severity.values()) {
if ((reportSummary.get(s) != null) && (reportSummary.get(s).isEmpty() == false)) {
- output += "| "+ this.severityToString(s) + " | "+severityTotals.get(s)+" |
\n";
+ output += "| "+ this.severityToString(s) + " | "+severityTotals.get(s)+" |
\n";
for (String alertTitle : reportSummary.get(s).keySet()) {
output += "| " + alertTitle + " | " + reportSummary.get(s).get(alertTitle) + " |
\n";
}
diff --git a/platform/com.subgraph.vega.scanner.modules/src/com/subgraph/vega/impl/scanner/modules/ScannerModuleRepository.java b/platform/com.subgraph.vega.scanner.modules/src/com/subgraph/vega/impl/scanner/modules/ScannerModuleRepository.java
index 7b6af2f3..c11f67df 100644
--- a/platform/com.subgraph.vega.scanner.modules/src/com/subgraph/vega/impl/scanner/modules/ScannerModuleRepository.java
+++ b/platform/com.subgraph.vega.scanner.modules/src/com/subgraph/vega/impl/scanner/modules/ScannerModuleRepository.java
@@ -123,6 +123,16 @@ public List getResponseProcessingModules() {
}
return modules;
}
+
+ @Override
+ public List getAllResponseProcessingModules() {
+ final List modules = new ArrayList();
+ for(ScriptedModule m: scriptLoader.getReallyAllModules()) {
+ if(m.getModuleType() == ModuleScriptType.RESPONSE_PROCESSOR)
+ modules.add(new ResponseProcessorScript(m));
+ }
+ return modules;
+ }
@Override
public List getBasicModules() {
@@ -133,6 +143,16 @@ public List getBasicModules() {
}
return modules;
}
+
+ @Override
+ public List getAllBasicModules() {
+ final List modules = new ArrayList();
+ for(ScriptedModule m: scriptLoader.getReallyAllModules()) {
+ if(m.getModuleType() == ModuleScriptType.BASIC_MODULE)
+ modules.add(new BasicModuleScript(m));
+ }
+ return modules;
+ }
protected void setPathFinder(IPathFinder pathFinder) {
this.pathFinder = pathFinder;
diff --git a/platform/com.subgraph.vega.scanner.modules/src/com/subgraph/vega/impl/scanner/modules/scripting/ScriptLoader.java b/platform/com.subgraph.vega.scanner.modules/src/com/subgraph/vega/impl/scanner/modules/scripting/ScriptLoader.java
index fa511330..9c99377e 100644
--- a/platform/com.subgraph.vega.scanner.modules/src/com/subgraph/vega/impl/scanner/modules/scripting/ScriptLoader.java
+++ b/platform/com.subgraph.vega.scanner.modules/src/com/subgraph/vega/impl/scanner/modules/scripting/ScriptLoader.java
@@ -101,11 +101,27 @@ public List getAllModulesByType(ModuleScriptType type) {
}
return result;
}
+
+ public List getReallyAllModulesByType(ModuleScriptType type) {
+ final List result = new ArrayList();
+ synchronized(modulePathMap) {
+ for(ScriptedModule m: modulePathMap.values()) {
+ if((type == null || type == m.getModuleType())) {
+ result.add(m);
+ }
+ }
+ }
+ return result;
+ }
public List getAllModules() {
return getAllModulesByType(null);
}
+ public List getReallyAllModules(){
+ return getReallyAllModulesByType(null);
+ }
+
public Scriptable getPreludeScope() {
return preludeLoader.getPreludeScope();
}
diff --git a/platform/com.subgraph.vega.scanner/src/com/subgraph/vega/impl/scanner/Scan.java b/platform/com.subgraph.vega.scanner/src/com/subgraph/vega/impl/scanner/Scan.java
index b446ef00..64befde2 100644
--- a/platform/com.subgraph.vega.scanner/src/com/subgraph/vega/impl/scanner/Scan.java
+++ b/platform/com.subgraph.vega.scanner/src/com/subgraph/vega/impl/scanner/Scan.java
@@ -267,6 +267,15 @@ private void reloadModules() {
basicModules = moduleRegistry.updateBasicModules(basicModules);
}
}
+
+ public void useAllModules()
+ {
+ IScannerModuleRegistry moduleRegistry = scanner.getScannerModuleRegistry();
+ responseProcessingModules = moduleRegistry.getAllResponseProcessingModules();
+ basicModules = moduleRegistry.getAllBasicModules();
+ responseProcessingModules = moduleRegistry.updateResponseProcessingModules(responseProcessingModules);
+ basicModules = moduleRegistry.updateBasicModules(basicModules);
+ }
public Scanner getScanner() {
return scanner;
diff --git a/platform/com.subgraph.vega.ui.scanner/.classpath b/platform/com.subgraph.vega.ui.scanner/.classpath
index 07d16cb7..4f5fdc6e 100644
--- a/platform/com.subgraph.vega.ui.scanner/.classpath
+++ b/platform/com.subgraph.vega.ui.scanner/.classpath
@@ -4,5 +4,6 @@
+
diff --git a/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/MyScanExecutor.java b/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/MyScanExecutor.java
new file mode 100644
index 00000000..cb0ef672
--- /dev/null
+++ b/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/MyScanExecutor.java
@@ -0,0 +1,392 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Subgraph.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Subgraph - initial API and implementation
+ ******************************************************************************/
+package com.subgraph.vega.ui.scanner;
+
+import java.net.HttpCookie;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.http.cookie.Cookie;
+import org.apache.http.impl.cookie.BasicClientCookie;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import com.subgraph.vega.api.scanner.IScan;
+import com.subgraph.vega.api.model.alerts.IScanInstance;
+import com.subgraph.vega.api.model.scope.ITargetScope;
+import com.subgraph.vega.api.scanner.IScanner;
+import com.subgraph.vega.api.scanner.IScannerConfig;
+import com.subgraph.vega.ui.scanner.preferences.IPreferenceConstants;
+
+/*---new imports---*/
+import com.subgraph.vega.api.util.UriTools;
+//import com.subgraph.vega.export.Activator;
+
+import java.util.Arrays;
+import java.util.Set;
+import java.util.HashSet;
+import com.subgraph.vega.api.model.identity.*;
+
+public class MyScanExecutor {
+
+ private boolean scanRunning = false;
+ private String target = "127.0.0.1";
+ private String userAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Vega/1.0";
+ private List cookieList = new ArrayList();
+ private List excludedParameters = Arrays.asList("csrfmiddlewaretoken","__viewstateencrypted","__eventvalidation",
+ "__eventtarget","__viewstate","xsrftoken","csrftoken","anticsrf","__eventargument");
+ private String identity = "";
+ private boolean logAllRequests = false;
+ private boolean displayDebugOutput = false;
+ private int maxRequestsPerSecond = 25;
+ private int maxScanDescendants = 8192;
+ private int maxScanChildren = 512;
+ private int maxScanDepth = 16;
+ private int maxScanDuplicatePaths = 3;
+ private int maxResponseLength = 1024;
+ private boolean useAllModules = false;
+
+
+ public boolean isUseAllModules() {
+ return useAllModules;
+ }
+
+ public void setUseAllModules(boolean useAllModules) {
+ this.useAllModules = useAllModules;
+ }
+
+ public String getTarget() {
+ return target;
+ }
+
+ public void setTarget(String target) {
+ this.target = target;
+ }
+
+ public String getUserAgent() {
+ return userAgent;
+ }
+
+ public void setUserAgent(String userAgent) {
+ this.userAgent = userAgent;
+ }
+
+ public List getCookieList() {
+ return cookieList;
+ }
+
+ public void setCookieList(List cookieList) {
+ this.cookieList = cookieList;
+ }
+
+ public List getExcludedParameters() {
+ return excludedParameters;
+ }
+
+ public void setExcludedParameters(List excludedParameters) {
+ this.excludedParameters = excludedParameters;
+ }
+
+ public String getIdentity() {
+ return identity;
+ }
+
+ public boolean setIdentity(String name, String username, String password) {
+
+ IIdentityModel identityModel = Activator.getDefault().getModel().getCurrentWorkspace().getIdentityModel();
+ IIdentity myIdentity = identityModel.createIdentity();
+
+ myIdentity.setName(name);
+ IAuthMethodRfc2617 myAuthMethod = Activator.getDefault().getModel().getCurrentWorkspace().getIdentityModel().createAuthMethodRfc2617();
+ myAuthMethod.setAuthScheme(IAuthMethodRfc2617.AuthScheme.AUTH_SCHEME_BASIC);
+ myAuthMethod.setUsername(username);
+ myAuthMethod.setPassword(password);
+ myIdentity.setAuthMethod(myAuthMethod);
+
+ IIdentity checkIdentity = identityModel.getIdentityByName(name);
+ if(checkIdentity == null)
+ {
+ //no identity like this exists
+ identityModel.store(myIdentity);
+ this.identity = name;
+ System.out.println("Identity stored.");
+ } else
+ {
+ IAuthMethod checkAuthMethod = checkIdentity.getAuthMethod();
+ //assert: we only have basic authentication (only type available for python)
+ if(checkAuthMethod.getType() == IAuthMethod.AuthMethodType.AUTH_METHOD_RFC2617)
+ {
+ IAuthMethodRfc2617 checkAuthMethod_basic = (IAuthMethodRfc2617) checkAuthMethod;
+ if(checkAuthMethod_basic.getUsername().equals(username) &&
+ checkAuthMethod_basic.getPassword().equals(password))
+ {
+ //exact same identity is already stored and can be used.
+ System.out.println("Using existing idenity.");
+ this.identity = name;
+ }else
+ {
+ //identity with same name but different credentials already exists
+ System.out.println("A differing identity with this name already exists (needs to be unique)!");
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public boolean isLogAllRequests() {
+ return logAllRequests;
+ }
+
+ public void setLogAllRequests(boolean logAllRequests) {
+ this.logAllRequests = logAllRequests;
+ }
+
+ public boolean isDisplayDebugOutput() {
+ return displayDebugOutput;
+ }
+
+ public void setDisplayDebugOutput(boolean displayDebugOutput) {
+ this.displayDebugOutput = displayDebugOutput;
+ }
+
+ public int getMaxRequestsPerSecond() {
+ return maxRequestsPerSecond;
+ }
+
+ public void setMaxRequestsPerSecond(int maxRequestsPerSecond) {
+ this.maxRequestsPerSecond = maxRequestsPerSecond;
+ }
+
+ public int getMaxScanDescendants() {
+ return maxScanDescendants;
+ }
+
+ public void setMaxScanDescendants(int maxScanDescendants) {
+ this.maxScanDescendants = maxScanDescendants;
+ }
+
+ public int getMaxScanChildren() {
+ return maxScanChildren;
+ }
+
+ public void setMaxScanChildren(int maxScanChildren) {
+ this.maxScanChildren = maxScanChildren;
+ }
+
+ public int getMaxScanDepth() {
+ return maxScanDepth;
+ }
+
+ public void setMaxScanDepth(int maxScanDepth) {
+ this.maxScanDepth = maxScanDepth;
+ }
+
+ public int getMaxScanDuplicatePaths() {
+ return maxScanDuplicatePaths;
+ }
+
+ public void setMaxScanDuplicatePaths(int maxScanDuplicatePaths) {
+ this.maxScanDuplicatePaths = maxScanDuplicatePaths;
+ }
+
+ public int getMaxResponseLength() {
+ return maxResponseLength;
+ }
+
+ public void setMaxResponseLength(int maxResponseLength) {
+ this.maxResponseLength = maxResponseLength;
+ }
+
+ public String runScan() {
+ final IScanner scanner = Activator.getDefault().getScanner();
+ final IScan scan = scanner.createScan();
+ //final Collection identities = Activator.getDefault().getModel().getCurrentWorkspace().getIdentityModel().getAllIdentities();
+ String result = null;
+ if(scanRunning) {
+ scan.stopScan();
+ System.out.println("Error. Tried starting a scan but there was already a scan running.");
+ } else {
+ result = maybeLaunchScanFromWizard(scanner, scan);
+ }
+ IScanInstance scanInstance = scan.getScanInstance();
+ if(scanInstance.getScanStatus() == IScanInstance.SCAN_AUDITING || scanInstance.getScanStatus() == IScanInstance.SCAN_PROBING ||
+ scanInstance.getScanStatus() == IScanInstance.SCAN_STARTING)
+ {
+ waitForScanToFinish(scanInstance);
+ }
+
+ return result;
+ }
+
+ private void waitForScanToFinish(IScanInstance s)
+ {
+ while(s.getScanStatus() == IScanInstance.SCAN_AUDITING || s.getScanStatus() == IScanInstance.SCAN_PROBING ||
+ s.getScanStatus() == IScanInstance.SCAN_STARTING)
+ {
+ try{
+ Thread.sleep(1000);
+ }catch(InterruptedException e)
+ {
+ break;
+ }
+ }
+ }
+
+ private String maybeLaunchScanFromWizard(IScanner scanner, IScan scan) {
+
+ /*---new code---*/
+
+ //--------scan target--------------//
+
+ //final ITargetScope scanTargetScope = wizard.getScanTargetScope();
+ //if(scanTargetScope == null) {
+ // return null;
+ //}
+
+ ITargetScope scanTargetScope;
+ scanTargetScope = Activator.getDefault().getModel().getCurrentWorkspace().getTargetScopeManager().createNewScope();
+ scanTargetScope.clear();
+ if(UriTools.isTextValidURI(target)) {
+ scanTargetScope.addScopeURI(UriTools.getURIFromText(target));
+ }
+ System.out.println("Using target "+ target);
+
+ final IScannerConfig config = scan.getConfig();
+ config.setScanTargetScope(scanTargetScope);
+ config.setUserAgent(userAgent);
+ System.out.println("Using userAgent "+ userAgent);
+
+ //--------cookies--------//
+
+ //config.setCookieList(getCookieListForScope(wizard.getCookieStringList(), scanTargetScope));
+
+ config.setCookieList(getCookieListForScope(cookieList, scanTargetScope));
+ System.out.println("Using cookieList: ");
+ for(int i = 0; i < cookieList.size(); i++)
+ {
+ System.out.print(cookieList.get(i) + ", ");
+ }
+ System.out.print("\n");
+
+ //-------identity-------//
+
+ //if no fitting identity has been found, the identity in the config will be null.
+ // This is the same as it has been before.
+
+ // config.setScanIdentity(wizard.getScanIdentity());
+
+
+ final Collection identities = Activator.getDefault().getModel().getCurrentWorkspace().getIdentityModel().getAllIdentities();
+ IIdentity myid = null;
+ for(IIdentity id : identities)
+ {
+ if(id.getName().equals(identity)){
+ myid = id;
+ break;
+ }
+ }
+ if(!(myid == null))
+ {
+ System.out.println("Using id "+ myid.getName());
+ }
+
+ config.setScanIdentity(myid);
+
+ //-------excluded parameters-------//
+
+ //config.setExcludedParameterNames(wizard.getExcludedParameterNames());
+
+ Set excludedParametersSet = new HashSet();
+ for(int i = 0; i < excludedParameters.size(); i++)
+ {
+ excludedParametersSet.add(excludedParameters.get(i));
+ }
+
+ config.setExcludedParameterNames(excludedParametersSet);
+
+
+ final IPreferenceStore preferences = Activator.getDefault().getPreferenceStore();
+ config.setLogAllRequests(logAllRequests);
+ config.setDisplayDebugOutput(displayDebugOutput);
+ config.setMaxRequestsPerSecond(maxRequestsPerSecond);
+ config.setMaxDescendants(maxScanDescendants);
+ config.setMaxChildren(maxScanChildren);
+ config.setMaxDepth(maxScanDepth);
+ config.setMaxDuplicatePaths(maxScanDuplicatePaths);
+ config.setMaxResponseKilobytes(maxResponseLength);
+
+ if(useAllModules)
+ {
+ scan.useAllModules();
+ }
+
+
+ //end of changes
+
+ final Thread probeThread = new Thread(new ScanProbeTask(scan));
+ probeThread.start();
+ synchronized (probeThread) {
+ try{
+ probeThread.wait();
+ }catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ return target;
+ }
+
+ private List getCookieListForScope(List cookieStringList, ITargetScope scope) {
+ final List cookies = new ArrayList();
+ for(URI uri: scope.getScopeURIs()) {
+ cookies.addAll(getCookieList(cookieStringList, uri));
+ }
+ return cookies;
+ }
+
+ // gross hack
+ private List getCookieList(List cookieStringList, URI uri) {
+ if (cookieStringList.size() != 0) {
+ ArrayList cookieList = new ArrayList(cookieStringList.size());
+ for (String cookieString: cookieStringList) {
+ List parseList = HttpCookie.parse(cookieString);
+ for (HttpCookie cookie: parseList) {
+ BasicClientCookie cp = new BasicClientCookie(cookie.getName(), cookie.getValue());
+ cp.setComment(cookie.getComment());
+ if (cookie.getDomain() != null) {
+ cp.setDomain(cookie.getDomain());
+ } else {
+ // just set it to the target host for now - may need something slightly less specific
+ cp.setDomain(uri.getHost());
+ }
+ long maxAge = cookie.getMaxAge();
+ if (maxAge > 0) {
+ Calendar calendar = Calendar.getInstance();
+ calendar.add(Calendar.SECOND, (int) maxAge);
+ cp.setExpiryDate(calendar.getTime());
+ }
+ cp.setPath(cookie.getPath());
+ cp.setSecure(cookie.getSecure());
+ cp.setVersion(cookie.getVersion());
+ cookieList.add(cp);
+ }
+ }
+ return cookieList;
+ }
+ return Collections.emptyList();
+ }
+}
diff --git a/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/ScanExecutor.java b/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/ScanExecutor.java
index f0190b6b..88c5342c 100644
--- a/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/ScanExecutor.java
+++ b/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/ScanExecutor.java
@@ -34,6 +34,12 @@
import com.subgraph.vega.ui.scanner.wizards.NewScanWizard;
import com.subgraph.vega.ui.scanner.wizards.NewWizardDialog;
+/*---new imports---*/
+import com.subgraph.vega.api.util.UriTools;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.HashSet;
+
public class ScanExecutor {
public String runScan(Shell shell, String target) {
@@ -53,7 +59,7 @@ public String runScan(Shell shell, String target) {
}
private String maybeLaunchScanFromWizard(Shell shell, NewScanWizard wizard, IScanner scanner, IScan scan) {
-
+
final ITargetScope scanTargetScope = wizard.getScanTargetScope();
if(scanTargetScope == null) {
return null;
@@ -62,9 +68,16 @@ private String maybeLaunchScanFromWizard(Shell shell, NewScanWizard wizard, ISca
final IScannerConfig config = scan.getConfig();
config.setScanTargetScope(scanTargetScope);
config.setUserAgent(IPreferenceConstants.P_USER_AGENT);
+
+
config.setCookieList(getCookieListForScope(wizard.getCookieStringList(), scanTargetScope));
+
+
config.setScanIdentity(wizard.getScanIdentity());
- config.setExcludedParameterNames(wizard.getExcludedParameterNames());
+
+
+ config.setExcludedParameterNames(wizard.getExcludedParameterNames());
+
final IPreferenceStore preferences = Activator.getDefault().getPreferenceStore();
config.setLogAllRequests(preferences.getBoolean(IPreferenceConstants.P_LOG_ALL_REQUESTS));
config.setDisplayDebugOutput(preferences.getBoolean(IPreferenceConstants.P_DISPLAY_DEBUG_OUTPUT));
diff --git a/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/ScanProbeTask.java b/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/ScanProbeTask.java
index 279b7c9f..64b95122 100644
--- a/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/ScanProbeTask.java
+++ b/platform/com.subgraph.vega.ui.scanner/src/com/subgraph/vega/ui/scanner/ScanProbeTask.java
@@ -31,6 +31,11 @@ public class ScanProbeTask implements Runnable {
this.shell = shell;
this.scan = scan;
}
+
+ ScanProbeTask(IScan scan) {
+ this.shell = null;
+ this.scan = scan;
+ }
@Override
public void run() {
@@ -51,26 +56,33 @@ public void run() {
private void processTargetURI(final URI uri) {
final IScanProbeResult probeResult = scan.probeTargetUri(uri);
- shell.getDisplay().syncExec(new Runnable() {
+ if(!processProbeResult(uri, probeResult)) {
+ cancelScan = true;
+ }
+ /*shell.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
if(!processProbeResult(uri, probeResult)) {
cancelScan = true;
}
}
- });
+ });*/
}
private boolean processProbeResult(URI uri, IScanProbeResult probeResult) {
if(probeResult.getProbeResultType() == ProbeResultType.PROBE_CONNECT_FAILED) {
- MessageDialog.openError(shell, "Failed to connect to target", probeResult.getFailureMessage());
+ //MessageDialog.openError(shell, "Failed to connect to target", probeResult.getFailureMessage());
+ System.out.println("Failed to connect to target. " + probeResult.getFailureMessage());
return false;
} else if(probeResult.getProbeResultType() == ProbeResultType.PROBE_REDIRECT) {
final URI redirectURI = probeResult.getRedirectTarget();
if(!isTrivialRedirect(uri, redirectURI)) {
- String message = "Target address "+ uri + " redirects to address "+ redirectURI + "\n\n"+
- "Would you like to add "+ redirectURI +" to the scope?";
- boolean doit = MessageDialog.openQuestion(shell, "Follow Redirect?", message);
+ //String message = "Target address "+ uri + " redirects to address "+ redirectURI + "\n\n"+
+ // "Would you like to add "+ redirectURI +" to the scope?";
+ System.out.println("Target address "+ uri + " redirects to address "+ redirectURI + "\n\n"+
+ "I added "+ redirectURI +" to the scope.");
+ //boolean doit = MessageDialog.openQuestion(shell, "Follow Redirect?", message);
+ boolean doit = true;
if(!doit) {
return false;
}
@@ -80,7 +92,8 @@ private boolean processProbeResult(URI uri, IScanProbeResult probeResult) {
return true;
} else if(probeResult.getProbeResultType() == ProbeResultType.PROBE_REDIRECT_FAILED) {
- MessageDialog.openError(shell, "Redirect failure", probeResult.getFailureMessage());
+ //MessageDialog.openError(shell, "Redirect failure", probeResult.getFailureMessage());
+ System.out.println("Redirect Failure. " + probeResult.getFailureMessage());
return false;
}
return true;
diff --git a/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageOne.java b/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageOne.java
index 2fa012fb..d5e40c51 100644
--- a/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageOne.java
+++ b/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageOne.java
@@ -68,7 +68,8 @@ public void widgetSelected(SelectionEvent e) {
htmlButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- choice = htmlButton.getText();
+ //choice = htmlButton.getText();
+ choice = "HTML";
}
});
diff --git a/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageThree.java b/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageThree.java
index 9ce383ff..1a87da87 100644
--- a/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageThree.java
+++ b/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageThree.java
@@ -18,6 +18,8 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import com.subgraph.vega.export.AlertExporter;
+
public class ExportWizardPageThree extends WizardPage {
protected FileDialog dialog;
@@ -52,6 +54,8 @@ public void createControl(Composite parent) {
textField.setSize(VISIBLE_PATH_LENGTH, textField.getSize().y);
Button button = new Button(container, SWT.NONE);
button.setText("Open");
+
+ final Composite parent1 = parent;
GridData buttonGridData = new GridData();
buttonGridData.horizontalSpan = 2;
@@ -66,7 +70,7 @@ public void createControl(Composite parent) {
@Override
public void widgetSelected(SelectionEvent e) {
- doFileDialog(parent.getShell());
+ doFileDialog(parent1.getShell());
}
@Override
@@ -89,6 +93,11 @@ public void widgetDefaultSelected(SelectionEvent e) {
setPageComplete(false);
setControl(container);
+ /*System.out.println("Started myexporter.");
+ AlertExporter myexporter = new AlertExporter();
+ myexporter.exportAllAlerts();
+ System.out.println("Finished myexporter.");*/
+
}
private void doFileDialog(Shell shell) {
diff --git a/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageTwo.java b/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageTwo.java
index ce8c59d3..61c520c8 100644
--- a/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageTwo.java
+++ b/platform/com.subgraph.vega.ui.util/src/com/subgraph/vega/ui/util/export/ExportWizardPageTwo.java
@@ -82,12 +82,12 @@ public void createControl(Composite parent) {
@Override
public void widgetSelected(SelectionEvent e) {
- if (selectAllButton.getSelection() == true) {
+ //if (selectAllButton.getSelection() == true) {
for (TreeItem t: alertsTree.getItems()) {
t.setChecked(true);
setPageComplete(true);
}
- }
+ //}
treeContainer.setOrigin (0, 10);
@@ -165,9 +165,9 @@ public void treeCollapsed (TreeEvent e) {
public void widgetSelected(SelectionEvent e) {
TreeItem ti = (TreeItem) e.item;
if (ti.getChecked() == false) {
- if (selectAllButton.getSelection() == true) {
+ /*if (selectAllButton.getSelection() == true) {
selectAllButton.setSelection(false);
- }
+ }*/
}