Package org.vfny.geoserver.config.validation

Examples of org.vfny.geoserver.config.validation.ValidationConfig


        try {
            File plugInDir = findConfigDir(rootDir, "plugIns");
            File validationDir = findConfigDir(rootDir, "validation");
            Map plugIns = XMLReader.loadPlugIns(plugInDir);
            Map testSuites = XMLReader.loadValidations(validationDir, plugIns);
            ValidationConfig vc = new ValidationConfig(plugIns, testSuites);
            sc.setAttribute(ValidationConfig.CONFIG_KEY, vc);
        } catch (Exception e) {
            // LOG error
            e.printStackTrace();
View Full Code Here


        MessageResources messages = servlet.getResources();
        String edit = messages.getMessage(locale, "label.edit");
        String delete = messages.getMessage(locale, "label.delete");
       
        ServletContext context = this.getServlet().getServletContext();
        ValidationConfig validationConfig = (ValidationConfig) context.getAttribute(ValidationConfig.CONFIG_KEY);
        TestSuiteConfig suiteConfig = (TestSuiteConfig) request.getSession().getAttribute(TestSuiteConfig.CURRENTLY_SELECTED_KEY);
       
        if (edit.equals(buttonAction)) {
            TestConfig testConfig = (TestConfig) suiteConfig.getTests().get(selectedTest);
            request.getSession().setAttribute(TestConfig.CURRENTLY_SELECTED_KEY, testConfig);
View Full Code Here

    public ActionForward execute(ActionMapping mapping,
            ActionForm incomingForm, UserContainer user, HttpServletRequest request,
            HttpServletResponse response){

        ServletContext context = this.getServlet().getServletContext();
        ValidationConfig validationConfig = (ValidationConfig) context.getAttribute(ValidationConfig.CONFIG_KEY);
               
        ValidationTestNewForm form = (ValidationTestNewForm) incomingForm;
       
        String newName = form.getNewName();
        String selectedPlugIn = form.getSelectedPlugIn();
       
        PlugInConfig plugIn = validationConfig.getPlugIn(selectedPlugIn);
       
        TestConfig testConfig = new TestConfig();
        testConfig.setName(newName);
        testConfig.setPlugIn(plugIn);
        testConfig.setArgs(new HashMap());
View Full Code Here

        MessageResources messages = servlet.getResources();
        String edit = messages.getMessage(locale, "label.edit");
        String delete = messages.getMessage(locale, "label.delete");

        ServletContext context = this.getServlet().getServletContext();
        ValidationConfig validationConfig = (ValidationConfig) context.getAttribute(ValidationConfig.CONFIG_KEY);
       
        if (edit.equals(buttonAction)) {
            TestSuiteConfig suiteConfig = (TestSuiteConfig) validationConfig.getTestSuites().get(selectedTestSuite);

            request.getSession().setAttribute(TestSuiteConfig.CURRENTLY_SELECTED_KEY, suiteConfig);
           
            return mapping.findForward("validationTest");           
        } else if (delete.equals(buttonAction)) {
            Map suites = validationConfig.getTestSuites();
            suites.remove(selectedTestSuite);
            validationConfig.setTestSuites(suites);
            getApplicationState().notifyConfigChanged();
           
            request.getSession().removeAttribute(TestSuiteConfig.CURRENTLY_SELECTED_KEY);
           
            return mapping.findForward("suite");
View Full Code Here

  public String getPlugInName() {
    return plugInName;
  }
   
    public String getPlugInDescription() {
        ValidationConfig validationConfig = (ValidationConfig) this.getServlet().getServletContext().getAttribute(ValidationConfig.CONFIG_KEY);
        PlugInConfig config = validationConfig.getPlugIn(plugInName);
        return config.getDescription();
    }
View Full Code Here

    private Set plugInNames;
   
    public void reset(ActionMapping arg0, HttpServletRequest request) {
        super.reset(arg0, request);
       
        ValidationConfig validationConfig = (ValidationConfig) this.getServlet().getServletContext().getAttribute(ValidationConfig.CONFIG_KEY);
        plugInConfigs = validationConfig.getPlugIns().values();
        plugInNames = validationConfig.getPlugInNames();
       
        newName ="";
    }
View Full Code Here

        return errors;
    }
   
    public SortedSet getTests() {
        ServletContext context = this.getServlet().getServletContext();
        ValidationConfig validationConfig = (ValidationConfig) context.getAttribute(ValidationConfig.CONFIG_KEY);
        TestSuiteConfig suiteConfig = (TestSuiteConfig) request.getSession().getAttribute(TestSuiteConfig.CURRENTLY_SELECTED_KEY);
        return new TreeSet(suiteConfig.getTests().keySet());
    }
View Full Code Here

    }   
   
    public SortedSet getTestSuites(){
      try{
        ServletContext context = getServlet().getServletContext();
        ValidationConfig validationConfig = (ValidationConfig) context.getAttribute(ValidationConfig.CONFIG_KEY);
        if(validationConfig!=null && validationConfig.getTestSuiteNames()!=null)
          return new TreeSet(validationConfig.getTestSuiteNames());
      }catch(Exception e){
        e.printStackTrace();
      }
        return new TreeSet();
    }
View Full Code Here

        sc.setAttribute(WFSConfig.CONFIG_KEY, new WFSConfig((WFSDTO)wfs.toDTO()));
        sc.setAttribute(GlobalConfig.CONFIG_KEY,
            new GlobalConfig((GeoServerDTO)wfs.getGeoServer().toDTO()));
        sc.setAttribute(DataConfig.CONFIG_KEY, new DataConfig((DataDTO)wfs.getData().toDTO()));
       
        ValidationConfig vc = null;
    try{
      vc = new ValidationConfig((Map)wfs.getValidation().toPlugInDTO(), (Map)wfs.getValidation().toTestSuiteDTO());
    }catch(Exception e){
      //load error
      vc = new ValidationConfig();
    }
        sc.setAttribute(ValidationConfig.CONFIG_KEY, vc);
    }
View Full Code Here

            oldThread.stop(); //This is decprecated, but is there another way to stop a Runnable?
        }
    } else {
     
        ServletContext context = this.getServlet().getServletContext();
        ValidationConfig validationConfig = (ValidationConfig) context.getAttribute(ValidationConfig.CONFIG_KEY);
        TestSuiteConfig suiteConfig = (TestSuiteConfig) request.getSession().getAttribute(TestSuiteConfig.CURRENTLY_SELECTED_KEY);
        Map plugins = new HashMap();
        Map testSuites = new HashMap();
        validationConfig.toDTO(plugins,testSuites); // return by ref.
        TestValidationResults results = new TestValidationResults();
        try {
          ValidationRunnable testThread = new ValidationRunnable(request);
          testThread.setup(results, getDataConfig().toRepository(context), plugins, testSuites);
         
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.config.validation.ValidationConfig

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.