Package com.subgraph.vega.api.model

Examples of com.subgraph.vega.api.model.IWorkspace


  public RequestEditView() {
    super();
    final IContentAnalyzerFactory contentAnalyzerFactory = Activator.getDefault().getContentAnalyzerFactoryService();
    // XXX we should be watching for workspace events
    final IWorkspace workspace = Activator.getDefault().getModel().getCurrentWorkspace();
    if(workspace != null) {
      contentAnalyzer = contentAnalyzerFactory.createContentAnalyzer(workspace.getScanAlertRepository().getProxyScanInstance());
      contentAnalyzer.setDefaultAddToRequestLog(true);
      contentAnalyzer.setAddLinksToModel(true);
    }
    IRequestOrigin requestOrigin = workspace.getRequestLog().getRequestOriginRequestEditor();
    IHttpRequestEngineFactory requestEngineFactory = Activator.getDefault().getHttpRequestEngineFactoryService();
    requestEngine = requestEngineFactory.createRequestEngine(IHttpRequestEngine.EngineConfigType.CONFIG_PROXY, requestEngineFactory.createConfig(), requestOrigin);
    requestBuilder = requestEngineFactory.createRequestBuilder();
  }
View Full Code Here


    final Object inputObj = tableViewer.getInput();
    if(!(inputObj instanceof IModel)) {
      return;
    }
    final IModel model = (IModel) inputObj;
    final IWorkspace workspace = model.getCurrentWorkspace();
    if(workspace == null) {
      return;
    }
   
    addRequestIdConditionRule(requestId);
   
    final IRequestLog requestLog = workspace.getRequestLog();
    final IRequestLogRecord record = requestLog.lookupRecord(requestId);
    if(record == null) {
      return;
    }
   
View Full Code Here

  private IHttpConditionSet conditionSet;
  private Composite composite;
 
  public ConfigureInterceptionContent(IModel model, TransactionDirection direction) {
    this.model = model;
    final IWorkspace workspace = model.getCurrentWorkspace();
    final IHttpConditionManager conditionManager = (workspace == null) ? (null) : (workspace.getHttpConditionMananger());
    this.conditionInput = new ConditionInput(conditionManager);
    this.direction = direction;
    this.conditionSetEventHandler = createConditionSetEventHandler();
    this.conditionSet = model.addConditionSetTracker(getConditionSetName(), conditionSetEventHandler);
  }
View Full Code Here

  private void handleWorkspaceClose(WorkspaceCloseEvent event) {
    setCurrentWorkspace(null);
  }
 
  private void setCurrentWorkspace(IWorkspace workspace) {
    final IWorkspace oldWorkspace = currentWorkspace;
    currentWorkspace = workspace;
    currentActiveScope = setScopeChangeListener(oldWorkspace, workspace);
    proxyScanner.handleWorkspaceChanged(workspace);
  }
View Full Code Here

      clearViewers();
      return;
    }
    requestViewer.displayHttpRequest(currentRecord.getRequest());
    responseViewer.displayHttpResponse(currentRecord.getResponse());
    IWorkspace workspace = Activator.getDefault().getModel().getCurrentWorkspace();
    if(workspace != null) {
      final Collection<IScanAlert> alerts = workspace.getScanAlertRepository().getAlertsByRequestId(currentRecord.getRequestId());
      if(!alerts.isEmpty()) {
        addResponseHighlights(alerts);
      }
    }
  }
View Full Code Here

    final String id = getConditionSetId();
    return manager.getConditionSet(id);
  }

  private IHttpConditionManager getConditionManager() {
    final IWorkspace workspace = model.getCurrentWorkspace();
    if(workspace == null) {
      return null;
    }
    return workspace.getHttpConditionMananger();
  }
View Full Code Here

public class CreateIdentity extends AbstractHandler {

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    final IWorkspace workspace = Activator.getDefault().getModel().getCurrentWorkspace();
    if (workspace != null) {     
      IIdentityModel identityModel = workspace.getIdentityModel();
      IdentityWizard wizard = new IdentityWizard();
      IdentityWizardDialog dialog = new IdentityWizardDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(), wizard);
      if (dialog.open() == IDialogConstants.OK_ID) {
        IIdentity identity = wizard.getIdentity();
        identityModel.store(identity);
View Full Code Here

    if(response == null) {
      logger.warning("ContentAnalyzer.processResponse() called with null response");
      return result;
    }

    final IWorkspace workspace = factory.getCurrentWorkspace();
    if(workspace == null) {
      logger.warning("ContentAnalyzer.processResponse() called while no workspace is active");
      return result;
    }
   
    if(addToRequestLog) {
      workspace.getRequestLog().addRequestResponse(response);
    }

    final VegaURI uri = VegaURI.fromHostAndRequest(response.getHost(), response.getOriginalRequest());
    final IWebPath path = workspace.getWebModel().getWebPathByUri(uri);
    path.setVisited(true);
   
    result.setDeclaredMimeType(mimeDetector.getDeclaredMimeType(response));
    result.setSniffedMimeType(mimeDetector.getSniffedMimeType(response));
   
    final String mimeType = getBestMimeType(result);
    if(mimeType != null && path.getMimeType() == null) {
      path.setMimeType(mimeType);
    }
   
    if(scrapePage)
      runExtractUrls(result, response, workspace.getWebModel());
    runResponseProcessingModules(response.getOriginalRequest(), response, result.getDeclaredMimeType(), result.getSniffedMimeType(), workspace);
    return result;
  }
View Full Code Here

    treePanel.setLayoutData(gd);
   
    createTreeViewer(treePanel);
    createTreeViewerButtons(treePanel);
   
    final IWorkspace workspace = Activator.getDefault().getModel().getCurrentWorkspace();
    if(workspace != null) {
      conditionManager = workspace.getHttpConditionMananger();
      conditionSet = conditionManager.getConditionSetCopy(conditionSetId);

    } else {
      conditionManager = null;
      conditionSet = null;
View Full Code Here

  private IIdentityModel identityModel;
  private Composite parentComposite;
  private TreeViewer identitiesViewer;

  public IdentitiesView() {
    IWorkspace currentWorkspace = Activator.getDefault().getModel().addWorkspaceListener(new IEventHandler() {
      @Override
      public void handleEvent(IEvent event) {
        if (event instanceof WorkspaceOpenEvent) {
          handleWorkspaceOpen((WorkspaceOpenEvent) event);
        } else if (event instanceof WorkspaceCloseEvent) {
          handleWorkspaceClose((WorkspaceCloseEvent) event);
        } else if (event instanceof WorkspaceResetEvent) {
          handleWorkspaceReset((WorkspaceResetEvent) event);
        }
      }
    });
    identityModel = currentWorkspace.getIdentityModel();
  }
View Full Code Here

TOP

Related Classes of com.subgraph.vega.api.model.IWorkspace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.