Package org.vfny.geoserver.util

Examples of org.vfny.geoserver.util.SLDValidator


            CharArrayReader xml = new CharArrayReader(sld_body.toCharArray()); // put the xml into a 'Reader'
   
            rootNode = generateDOM(xml);
   
            // validate the SLD
            SLDValidator validator = new SLDValidator();
            List errors = validator.validateSLD(fs, context);
   
            if (errors.size() != 0) {
                throw new SldException(SLDValidator.getErrorMessage(xml, errors));
            }
        } finally {
View Full Code Here


     * validates an sld document.
     *
     */
    private List validateSld(InputStream input) {
        // user requested to validate the schema.
        SLDValidator validator = new SLDValidator();

        return validator.validateSLD(input, httpRequest.getSession().getServletContext());
    }
View Full Code Here

     * @throws Exception
     * @throws WmsException DOCUMENT ME!
     */
    public void validateSchemaSLD(File f, GetMapRequest getMapRequest)
        throws Exception {
        SLDValidator validator = new SLDValidator();
        List errors = null;

        try {
            FileInputStream in = null;

            try {
                in = new FileInputStream(f);
                errors = validator.validateSLD(in,
                        getMapRequest.getHttpServletRequest().getSession().getServletContext());
            } finally {
                if (in != null) {
                    in.close();
                }
View Full Code Here

            return validate10(input, entityResolver);
        }
    }

    List<Exception> validate10(Object input, EntityResolver entityResolver) throws IOException {
        return new SLDValidator().validateSLD(new InputSource(toReader(input)));
    }
View Full Code Here

     *
     * @throws Exception
     * @throws ServiceException
     */
    public void validateSchemaSLD(File f, GetMapRequest getMapRequest) throws Exception {
        SLDValidator validator = new SLDValidator();
        List errors = null;

        try {
            FileInputStream in = null;

            try {
                in = new FileInputStream(f);
                errors = validator.validateSLD(in);
            } finally {
                if (in != null) {
                    in.close();
                }
            }
View Full Code Here

     * @throws Exception
     * @throws WmsException DOCUMENT ME!
     */
    public void validateSchemaSLD(File f, GetMapRequest getMapRequest)
        throws Exception {
        SLDValidator validator = new SLDValidator();
        List errors = null;

        try {
            FileInputStream in = null;

            try {
                in = new FileInputStream(f);
                errors = validator.validateSLD(in,
                        getMapRequest.getHttpServletRequest().getSession()
                                     .getServletContext());
            } finally {
                if (in != null) {
                    in.close();
View Full Code Here

        {
          //Get a reader from the given string
            Reader reader = getReaderFromString(sldBody);
          //-InputStream in = new StringBufferInputStream(sldBody);
          // user requested to validate the schema.
          SLDValidator validator = new SLDValidator();
          List errors =null;

           //Create a sax input source from the reader
            InputSource in = new InputSource(reader);
            errors = validator.validateSLD(in, request.getHttpServletRequest().getSession().getServletContext());
            if (errors.size() != 0) {
              reader = getReaderFromString(sldBody);
              throw new WmsException(SLDValidator.getErrorMessage(reader, errors));
            }
//-        errors = validator.validateSLD(in, request.getHttpServletRequest().getSession().getServletContext());
View Full Code Here

       
        if (getValue("VALIDATESCHEMA") != null)
        {
          // user requested to validate the schema.
          SLDValidator validator = new SLDValidator();
          List errors =null;
          try {
            //JD: GEOS-420, Wrap the sldUrl in getINputStream method in order
            // to do compression
            InputStream in = getInputStream(sldUrl);
            errors = validator.validateSLD(in, request.getHttpServletRequest().getSession().getServletContext());
            in.close();
            if (errors.size() != 0)
              throw new WmsException(SLDValidator.getErrorMessage(sldUrl.openStream(),errors));
          }
          catch (IOException e)
View Full Code Here

   * @param file
   * @return
   */
  private List getSchemaExceptions(FormFile file, HttpServletRequest request)
  {
    SLDValidator validator = new SLDValidator();
   
    ServletContext sc = request.getSession().getServletContext();
    try{
      List l = validator.validateSLD(file.getInputStream(),sc );
      return l;
    }
    catch (Exception e)
    {
      ArrayList al = new ArrayList();
View Full Code Here

            CharArrayReader xml = new CharArrayReader(sld_body.toCharArray()); // put the xml into a 'Reader'
   
            rootNode = generateDOM(xml);
   
            // validate the SLD
            SLDValidator validator = new SLDValidator();
            String baseURL = ResponseUtils.baseURL(request);
            List errors = validator.validateSLD(fs, baseURL);
   
            if (errors.size() != 0) {
                throw new SldException(SLDValidator.getErrorMessage(xml, errors));
            }
        } finally {
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.util.SLDValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.