Java 类org.kohsuke.stapler.WebMethod 实例源码

项目:jenkins.py    文件:ConsoleAnnotationDescriptorPW.java   
@Override
@WebMethod(name = "script.js")
public void doScriptJs(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    initPython();
    if (pexec.isImplemented(2)) {
        pexec.execPythonVoid("do_script_js", req, rsp);
    } else {
        super.doScriptJs(req, rsp);
    }
}
项目:jenkins.py    文件:ConsoleAnnotationDescriptorPW.java   
@Override
@WebMethod(name = "style.css")
public void doStyleCss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    initPython();
    if (pexec.isImplemented(3)) {
        pexec.execPythonVoid("do_style_css", req, rsp);
    } else {
        super.doStyleCss(req, rsp);
    }
}
项目:jenkins.py    文件:ConsoleAnnotationDescriptorPW.java   
@Override
@WebMethod(name = "script.js")
public void doScriptJs(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    initPython();
    if (pexec.isImplemented(2)) {
        pexec.execPythonVoid("do_script_js", req, rsp);
    } else {
        super.doScriptJs(req, rsp);
    }
}
项目:jenkins.py    文件:ConsoleAnnotationDescriptorPW.java   
@Override
@WebMethod(name = "style.css")
public void doStyleCss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    initPython();
    if (pexec.isImplemented(3)) {
        pexec.execPythonVoid("do_style_css", req, rsp);
    } else {
        super.doStyleCss(req, rsp);
    }
}
项目:jenkins.py    文件:JobPW.java   
@Override
@WebMethod(name = "config.xml")
public void doConfigDotXml(StaplerRequest req, StaplerResponse rsp) throws IOException {
    initPython();
    if (pexec.isImplemented(96)) {
        pexec.execPythonVoid("do_config_dot_xml", req, rsp);
    } else {
        super.doConfigDotXml(req, rsp);
    }
}
项目:jenkins.py    文件:ViewPW.java   
@Override
@WebMethod(name = "config.xml")
public HttpResponse doConfigDotXml(StaplerRequest req) throws IOException {
    initPython();
    if (pexec.isImplemented(48)) {
        return (HttpResponse) pexec.execPython("do_config_dot_xml", req);
    } else {
        return super.doConfigDotXml(req);
    }
}
项目:jenkins.py    文件:ConsoleAnnotatorFactoryPW.java   
@Override
@WebMethod(name = "script.js")
public void doScriptJs(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    initPython();
    if (pexec.isImplemented(3)) {
        pexec.execPythonVoid("do_script_js", req, rsp);
    } else {
        super.doScriptJs(req, rsp);
    }
}
项目:jenkins.py    文件:ConsoleAnnotatorFactoryPW.java   
@Override
@WebMethod(name = "style.css")
public void doStyleCss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    initPython();
    if (pexec.isImplemented(4)) {
        pexec.execPythonVoid("do_style_css", req, rsp);
    } else {
        super.doStyleCss(req, rsp);
    }
}
项目:jenkins-inheritance-plugin    文件:InheritanceProject.java   
/**
 * Accepts <tt>config.xml</tt> submission, as well as serve it.
 */
@Override
@WebMethod(name = "config.xml")
public void doConfigDotXml(StaplerRequest req, StaplerResponse rsp)
        throws IOException {
    /* Job reconfiguration is handled by the superclass, as there is no
     * need to involve versioning/inheritance there 
     */
    if (req.getMethod().equals("POST")) {
        super.doConfigDotXml(req, rsp);
    }
    if (!req.getMethod().equals("GET")) {
        //Huh? Only GET/POST make sense
        rsp.sendError(SC_BAD_REQUEST);
    }

    //Check that the calling user is allowed to read the config
    checkPermission(EXTENDED_READ);

    //Fetch the user-selected version (defaults to stable version)
    //Note: Transient projects have no config.xml and can't use super.dCDX()
    if (!this.isTransient) {
        Long latestVersion = this.getLatestVersion();
        Long selectedVersion = VersionHandler.getVersion(this);
        if (selectedVersion == null || selectedVersion == latestVersion) {
            //The super-method can handle these cases just fine
            super.doConfigDotXml(req, rsp);
            return;
        }
    }

    try {
        // Tell the client browser to expect XML
        rsp.setContentType("application/xml");
        // Send the modified XML to the user
        this.writeStableConfigDotXml(rsp.getOutputStream());
    } catch (HttpStatusException ex) {
        rsp.sendError(ex.status, ex.getMessage());
        return;
    }
}
项目:mesos-plugin    文件:MesosComputer.java   
@Override
@WebMethod(name="slave-agent.jnlp")
public HttpResponse doSlaveAgentJnlp(StaplerRequest req, StaplerResponse res) throws IOException, ServletException {
 return new EncryptedSlaveAgentJnlpFile(this, "mesos-slave-agent.jnlp.jelly", getName(), CONNECT);
}