Class JsonServlet

  • All Implemented Interfaces:
    MultipartRequestWrapper.ParsingStrategy, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    @WebServlet(name="JSONService",
                urlPatterns="/dataservice")
    public class JsonServlet
    extends VitroHttpServlet
    This servlet is for servicing requests for JSON objects/data. It could be generalized to get other types of data ex. XML, HTML etc
    Author:
    bdc34 Moved most of the logic into a group of JsonProducer classes. jeb228
    See Also:
    Serialized Form
    • Constructor Detail

      • JsonServlet

        public JsonServlet()
    • Method Detail

      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest req,
                              javax.servlet.http.HttpServletResponse resp)
                       throws javax.servlet.ServletException,
                              IOException
        Description copied from class: VitroHttpServlet
        doPost does the same thing as the doGet method
        Overrides:
        doPost in class VitroHttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             IOException
        Description copied from class: VitroHttpServlet
        doGet does nothing.
        Overrides:
        doGet in class VitroHttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • getSearchIndividualsByVClass

        public static com.fasterxml.jackson.databind.node.ObjectNode getSearchIndividualsByVClass​(String vclassURI,
                                                                                                  javax.servlet.http.HttpServletRequest req)
                                                                                           throws Exception
        Throws:
        Exception
      • getSearchIndividualsByVClasses

        public static com.fasterxml.jackson.databind.node.ObjectNode getSearchIndividualsByVClasses​(List<String> vclassURIs,
                                                                                                    javax.servlet.http.HttpServletRequest req)
                                                                                             throws Exception
        Throws:
        Exception
      • getRandomSearchIndividualsByVClass

        public static com.fasterxml.jackson.databind.node.ObjectNode getRandomSearchIndividualsByVClass​(String vclassURI,
                                                                                                        javax.servlet.http.HttpServletRequest req)
                                                                                                 throws Exception
        Throws:
        Exception