Search in sources :

Example 46 with Session

use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.

the class PopupMenuItemIncludeInContext method performHistoryReferenceActions.

@Override
public void performHistoryReferenceActions(List<HistoryReference> hrefs) {
    Session session = Model.getSingleton().getSession();
    if (context != null) {
        recreateUISharedContexts(session);
    }
    super.performHistoryReferenceActions(hrefs);
    // Show the session dialog without recreating UI Shared contexts
    View.getSingleton().showSessionDialog(session, ContextIncludePanel.getPanelName(context.getId()), false);
}
Also used : Session(org.parosproxy.paros.model.Session)

Example 47 with Session

use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.

the class PopupMenuItemSiteNodeContextMenuFactory method isButtonEnabledForSiteNode.

@Override
public boolean isButtonEnabledForSiteNode(SiteNode sn) {
    final List<JMenuItem> mainPopupMenuItems = View.getSingleton().getPopupList();
    for (ExtensionPopupMenuItem menu : subMenus) {
        mainPopupMenuItems.remove(menu);
    }
    subMenus.clear();
    // Add the existing contexts
    Session session = Model.getSingleton().getSession();
    List<Context> contexts = session.getContexts();
    for (Context context : contexts) {
        ExtensionPopupMenuItem piicm = getContextMenu(context, this.parentMenu);
        piicm.setMenuIndex(this.getMenuIndex());
        mainPopupMenuItems.add(piicm);
        this.subMenus.add(piicm);
    }
    return false;
}
Also used : Context(org.zaproxy.zap.model.Context) ExtensionPopupMenuItem(org.parosproxy.paros.extension.ExtensionPopupMenuItem) JMenuItem(javax.swing.JMenuItem) Session(org.parosproxy.paros.model.Session)

Example 48 with Session

use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.

the class PopupMenuItemContextDataDriven method reCreateSubMenu.

protected void reCreateSubMenu(SiteNode sn) {
    final List<JMenuItem> mainPopupMenuItems = View.getSingleton().getPopupList();
    for (ExtensionPopupMenuItem menu : subMenus) {
        mainPopupMenuItems.remove(menu);
    }
    subMenus.clear();
    Session session = Model.getSingleton().getSession();
    List<Context> contexts = session.getContexts();
    for (Context context : contexts) {
        if (context.isIncluded(sn)) {
            ExtensionPopupMenuItem piicm = createPopupDataDrivenNodeMenu(context);
            piicm.setMenuIndex(this.getMenuIndex());
            mainPopupMenuItems.add(piicm);
            this.subMenus.add(piicm);
        }
    }
}
Also used : Context(org.zaproxy.zap.model.Context) ExtensionPopupMenuItem(org.parosproxy.paros.extension.ExtensionPopupMenuItem) JMenuItem(javax.swing.JMenuItem) Session(org.parosproxy.paros.model.Session)

Example 49 with Session

use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.

the class PopupMenuItemContextExclude method reCreateSubMenu.

protected void reCreateSubMenu() {
    final List<JMenuItem> mainPopupMenuItems = View.getSingleton().getPopupList();
    for (ExtensionPopupMenuItem menu : subMenus) {
        mainPopupMenuItems.remove(menu);
    }
    subMenus.clear();
    Session session = Model.getSingleton().getSession();
    List<Context> contexts = session.getContexts();
    for (Context context : contexts) {
        ExtensionPopupMenuItem piicm = createPopupExcludeFromContextMenu(context);
        piicm.setMenuIndex(this.getMenuIndex());
        mainPopupMenuItems.add(piicm);
        this.subMenus.add(piicm);
    }
}
Also used : Context(org.zaproxy.zap.model.Context) ExtensionPopupMenuItem(org.parosproxy.paros.extension.ExtensionPopupMenuItem) JMenuItem(javax.swing.JMenuItem) Session(org.parosproxy.paros.model.Session)

Example 50 with Session

use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.

the class PopupMenuItemExcludeFromContext method performHistoryReferenceActions.

@Override
public void performHistoryReferenceActions(List<HistoryReference> hrefs) {
    Session session = Model.getSingleton().getSession();
    // Manually create the UI shared contexts so any modifications are done
    // on an UI shared Context, so changes can be undone by pressing Cancel
    View.getSingleton().getSessionDialog().recreateUISharedContexts(session);
    super.performHistoryReferenceActions(hrefs);
    // Show the session dialog without recreating UI Shared contexts
    View.getSingleton().showSessionDialog(session, ContextExcludePanel.getPanelName(context.getId()), false);
}
Also used : Session(org.parosproxy.paros.model.Session)

Aggregations

Session (org.parosproxy.paros.model.Session)51 DatabaseException (org.parosproxy.paros.db.DatabaseException)18 Context (org.zaproxy.zap.model.Context)14 ArrayList (java.util.ArrayList)8 JMenuItem (javax.swing.JMenuItem)7 ExtensionPopupMenuItem (org.parosproxy.paros.extension.ExtensionPopupMenuItem)7 File (java.io.File)5 SiteNode (org.parosproxy.paros.model.SiteNode)5 HttpMalformedHeaderException (org.parosproxy.paros.network.HttpMalformedHeaderException)5 URIException (org.apache.commons.httpclient.URIException)4 RecordStructure (org.parosproxy.paros.db.RecordStructure)4 HttpMessage (org.parosproxy.paros.network.HttpMessage)4 ApiException (org.zaproxy.zap.extension.api.ApiException)4 ApiResponseElement (org.zaproxy.zap.extension.api.ApiResponseElement)4 Date (java.util.Date)3 HashMap (java.util.HashMap)3 PatternSyntaxException (java.util.regex.PatternSyntaxException)3 JFileChooser (javax.swing.JFileChooser)3 JSONException (net.sf.json.JSONException)3 ExtensionHistory (org.parosproxy.paros.extension.history.ExtensionHistory)3