@Override protected int run() throws Exception { view.checkPermission(View.READ); view.writeXml(stdout); return 0; } }
@Override protected int run() throws Exception { view.checkPermission(View.CONFIGURE); if (!(view instanceof DirectlyModifiableView)) throw new IllegalStateException("'" + view.getDisplayName() + "' view can not be modified directly"); for (TopLevelItem job: jobs) { ((DirectlyModifiableView) view).remove(job); } return 0; } }
@Override protected int run() throws Exception { view.checkPermission(View.CONFIGURE); if (!(view instanceof DirectlyModifiableView)) throw new IllegalStateException( "'" + view.getDisplayName() + "' view can not be modified directly"); for (TopLevelItem job: jobs) { ((DirectlyModifiableView) view).add(job); } return 0; } }
checkPermission(CONFIGURE); StringWriter out = new StringWriter(); try {
)); view.checkPermission(View.READ); if (view instanceof ViewGroup) { group = (ViewGroup) view;
/** * Accepts the new description. */ @RequirePOST public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(CONFIGURE); description = req.getParameter("description"); save(); rsp.sendRedirect("."); // go to the top page }
view.checkPermission(View.DELETE);
/** * Deletes this view. */ @RequirePOST public synchronized void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(DELETE); owner.deleteView(this); rsp.sendRedirect2(req.getContextPath()+"/" + owner.getUrl()); }
/** * Accepts {@code config.xml} submission, as well as serve it. */ @WebMethod(name = "config.xml") public HttpResponse doConfigDotXml(StaplerRequest req) throws IOException { if (req.getMethod().equals("GET")) { // read checkPermission(READ); return new HttpResponse() { public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { rsp.setContentType("application/xml"); View.this.writeXml(rsp.getOutputStream()); } }; } if (req.getMethod().equals("POST")) { // submission updateByXml(new StreamSource(req.getReader())); return HttpResponses.ok(); } // huh? return HttpResponses.error(SC_BAD_REQUEST, "Unexpected request method " + req.getMethod()); }
/** * Accepts submission from the configuration page. * * Subtypes should override the {@link #submit(StaplerRequest)} method. */ @RequirePOST public final synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(CONFIGURE); submit(req); description = Util.nullify(req.getParameter("description")); filterExecutors = req.getParameter("filterExecutors") != null; filterQueue = req.getParameter("filterQueue") != null; rename(req.getParameter("name")); getProperties().rebuild(req, req.getSubmittedForm(), getApplicablePropertyDescriptors()); save(); FormApply.success("../" + Util.rawEncode(name)).generateResponse(req,rsp,this); }
@Override protected int run() throws Exception { view.checkPermission(View.READ); view.writeXml(stdout); return 0; } }
@Override protected int run() throws Exception { view.checkPermission(View.CONFIGURE); if (!(view instanceof DirectlyModifiableView)) throw new IllegalStateException( "'" + view.getDisplayName() + "' view can not be modified directly"); for (TopLevelItem job: jobs) { ((DirectlyModifiableView) view).add(job); } return 0; } }
@Override protected int run() throws Exception { view.checkPermission(View.CONFIGURE); if (!(view instanceof DirectlyModifiableView)) throw new IllegalStateException("'" + view.getDisplayName() + "' view can not be modified directly"); for (TopLevelItem job: jobs) { ((DirectlyModifiableView) view).remove(job); } return 0; } }
/** * Accepts the new description. */ public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(CONFIGURE); description = req.getParameter("description"); owner.save(); rsp.sendRedirect("."); // go to the top page }
/** * Accepts the new description. */ public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(CONFIGURE); description = req.getParameter("description"); owner.save(); rsp.sendRedirect("."); // go to the top page }
/** * Accepts the new description. */ @RequirePOST public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(CONFIGURE); description = req.getParameter("description"); save(); rsp.sendRedirect("."); // go to the top page }
/** * Deletes this view. */ public synchronized void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { requirePOST(); checkPermission(DELETE); owner.deleteView(this); rsp.sendRedirect2(req.getContextPath()+"/" + owner.getUrl()); }
/** * Deletes this view. */ @RequirePOST public synchronized void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(DELETE); owner.deleteView(this); rsp.sendRedirect2(req.getContextPath()+"/" + owner.getUrl()); }
/** * Deletes this view. */ public synchronized void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { requirePOST(); checkPermission(DELETE); owner.deleteView(this); rsp.sendRedirect2(req.getContextPath()+"/" + owner.getUrl()); }
/** * Deletes this view. */ public synchronized void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { requirePOST(); checkPermission(DELETE); owner.deleteView(this); rsp.sendRedirect2(req.getContextPath()+"/" + owner.getUrl()); }