public String getAction() { return WebForm.this.getAction(); } public void setAction( String newAction ) { setDestination( newAction ); _presetParameters = null; }
public String getAction() { return WebForm.this.getAction(); } public void setAction( String newAction ) { setDestination( newAction ); _presetParameters = null; }
public String getAction() { return WebForm.this.getAction(); } public void setAction( String newAction ) { setDestination( newAction ); _presetParameters = null; }
/** * Gets the form with a specified action, or throw an error */ public static WebForm getFormWithAction(WebResponse response, String actionName) throws ProcessingException, SAXException { WebForm[] forms = response.getForms(); for( int i=0; i<forms.length; i++ ) { WebForm form = forms[i]; if(form.getAction().equals(actionName)) return form; } throw new ProcessingException("Unable to find a form with action="+actionName); }
/** * Gets the list member form to mass subscribe/unsubscribe addresses. */ private WebForm getListMemberForm(SubscriptionMode mode) throws IOException, SAXException, ProcessingException { WebResponse response = goTo(project._getURL()+"/servlets/MailingListMembers?list="+name+"&group="+mode.groupName); for( WebForm form : response.getForms() ) { if (form.getAction().equals("MailingListMembers")) return form; } throw new ProcessingException("Error: this is not the Mailing List Members Form!"); }
protected Void scrape() throws IOException, SAXException, ProcessingException { WebResponse response = goTo(project._getURL()+"/servlets/ProjectMailingListList"); for (WebForm form : response.getForms()) { if(!form.getAction().equals("ProjectMailingListList")) continue; if(!form.getParameterValue("listName").equals(name)) continue; // found the form SubmitButton sb = form.getSubmitButtons()[0]; if(!sb.getValue().equals("Subscribe")) throw new ProcessingException("Found "+sb.getValue()+" but expected Subscribe"); // set the mode form.setParameter("subtype",mode.getNameAsWord()); checkError(form.submit(sb)); return null; } throw new ProcessingException("no subscription form found"); } }.run();
WebForm[] forms = r.getForms(); for (WebForm form : forms) { String action = form.getAction(); if ((action != null) && (action.contains("ProjectDocumentEdit?action=Edit%20file"))) { form.setParameter("name",fileName);