Examples of ValidationProcessor


Examples of org.geotools.validation.ValidationProcessor

    }

    protected void integrityValidation(Map stores, Envelope check)
        throws IOException, WfsTransactionException {
        Data catalog = request.getWFS().getData();
        ValidationProcessor validation = request.getValidationProcessor();
        if( validation == null ) {
            LOGGER.warning( "Validation Processor unavaialble" );
            return;
        }
        LOGGER.finer( "Required to validate "+stores.size()+" typeRefs" );
        LOGGER.finer( "within "+check );
        // go through each modified typeName
        // and ask what we need to check
        //
        Set typeRefs = new HashSet();               
        for (Iterator i = stores.keySet().iterator(); i.hasNext();) {
            String typeRef = (String) i.next();
            typeRefs.add( typeRef );
           
            Set dependencies = validation.getDependencies( typeRef );
            LOGGER.finer( "typeRef "+typeRef+" requires "+dependencies);           
            typeRefs.addAll( dependencies );
        }

        // Grab a source for each typeName we need to check
        // Grab from the provided stores - so we check against
        // the transaction
        //
        Map sources = new HashMap();

        for (Iterator i = typeRefs.iterator(); i.hasNext();) {
            String typeRef = (String) i.next();
            LOGGER.finer("Searching for required typeRef: " + typeRef );

            if (stores.containsKey( typeRef )) {
                LOGGER.finer(" found required typeRef: " + typeRef +" (it was already loaded)");               
                sources.put( typeRef, stores.get(typeRef));
            } else {
                // These will be using Transaction.AUTO_COMMIT
                // this is okay as they were not involved in our
                // Transaction...
                LOGGER.finer(" could not find typeRef: " + typeRef +" (we will now load it)");
                String split[] = typeRef.split(":");
                String dataStoreId = split[0];
                String typeName = split[1];
                LOGGER.finer(" going to look for dataStoreId:"+dataStoreId+" and typeName:"+typeName );               
               
                // FeatureTypeInfo meta = catalog.getFeatureTypeInfo(typeName);
                String uri = catalog.getDataStoreInfo( dataStoreId ).getNameSpace().getURI();
                LOGGER.finer(" sorry I mean uri: " + uri +" and typeName:"+typeName );
               
                FeatureTypeInfo meta = catalog.getFeatureTypeInfo( typeName, uri );
                if( meta == null ){
                  throw new IOException( "Could not find typeRef:"+typeRef +" for validation processor" );
                }
                LOGGER.finer(" loaded required typeRef: " + typeRef );               
                sources.put( typeRef, meta.getFeatureSource());                                               
            }
        }
        LOGGER.finer( "Total of "+sources.size()+" featureSource marshalled for testing" );
        final Map failed = new TreeMap();
        ValidationResults results = new ValidationResults() {
                String name;
                String description;

                public void setValidation(Validation validation) {
                    name = validation.getName();
                    description = validation.getDescription();
                }

                public void error(Feature feature, String message) {
                    LOGGER.warning(name + ": " + message + " (" + description
                        + ")");
                    if (feature == null) {
                        failed.put("ALL",
                                name + ": " + message + " " + "(" + description + ")");                       
                    } else {
                    failed.put(feature.getID(),
                        name + ": " + message + " " + "(" + description + ")");
                    }
                }

                public void warning(Feature feature, String message) {
                    LOGGER.warning(name + ": " + message + " (" + description
                        + ")");
                }
            };

        try {
          //should never be null, but confDemo is giving grief, and I
          //don't want transactions to mess up just because validation
          //stuff is messed up. ch
            LOGGER.finer("Runing integrity tests using validation processor ");
          validation.runIntegrityTests(stores.keySet(), sources, check, results);         
        } catch (Exception badIdea) {
            badIdea.printStackTrace();
            // ValidationResults should of handled stuff will redesign :-)
            throw new DataSourceException("Validation Failed", badIdea);
        }
View Full Code Here

Examples of org.geotools.validation.ValidationProcessor

      return gs;
    }

   
    public ValidationProcessor getValidationProcessor(){
      ValidationProcessor vp = getWFS().getValidation();
      return vp;
    }
View Full Code Here

Examples of org.geotools.validation.ValidationProcessor

    */
  }
 
  public void setup(TestValidationResults vr, Repository repo, Map plugins, Map testSuites) throws Exception
  {
    gv = new ValidationProcessor();
    gv.load(plugins, testSuites);
    results = vr;
    repository = repo;
    validator = new Validator(repository, gv);
   
View Full Code Here

Examples of org.locationtech.udig.validation.ValidationProcessor

         */
        public Object[] getChildren(Object parentElement) {
            if (parentElement instanceof ValidationProcessor) {
                // this is the root of our tree; at this point we want to return
        // the list of all available plugins as children
                ValidationProcessor processor = (ValidationProcessor) parentElement;
                return processor.getPlugins().toArray();
            } else if (parentElement instanceof PlugInDTO) {
              // this is a plugin (validation test), so we'll grab instances of
        // each test for this type
            return validationProcessor.getTests(parentElement);
            }
View Full Code Here

Examples of org.locationtech.udig.validation.ValidationProcessor

        /* (non-Javadoc)
         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
         */
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
          if( newInput == oldInput ) return;
          ValidationProcessor newProcessor = (ValidationProcessor) newInput;
          validationProcessor = newProcessor;         
        }
View Full Code Here

Examples of org.locationtech.udig.validation.ValidationProcessor

        treeLabel.setFont(font);
        treeLabel.setText(Messages.ValidationDialog_validations);
        GridData labelData = new GridData();
        treeLabel.setLayoutData(labelData);
       
        ValidationProcessor tempProcessor = loadDialogState(ApplicationGIS.getActiveMap());
        if (tempProcessor == null) {
            processor = createProcessor(null, null);
            defaultTestSuite = "testSuite1"; //$NON-NLS-1$
        } else {
            processor = tempProcessor;
View Full Code Here

Examples of org.locationtech.udig.validation.ValidationProcessor

            URL pluginURL = ValidationPlugin.getDefault().getBundle().getResource("plugins"); //$NON-NLS-1$
            String pluginsPath = Platform.asLocalURL(pluginURL).getFile();
//            String pluginsPath = FileLocator.toFileURL(pluginURL).getFile();
            pluginsDir = new File(pluginsPath);
        }
        return new ValidationProcessor(pluginsDir, testSuiteFile);
    }
View Full Code Here

Examples of org.openfaces.component.validation.ValidationProcessor

    public void encodeEnd(FacesContext context, UIComponent component)
            throws IOException {
        super.encodeEnd(context, component);

        ValidationProcessor processor = ValidationProcessor.getInstance(context);
        HtmlMessages htmlMessages = (HtmlMessages) component;
        if (processor != null) {
            String styleClassName = Styles.getCSSClass(context, component, htmlMessages.getStyle(), htmlMessages.getStyleClass());

            Script clientScript = getClientScript(context, component, styleClassName);
View Full Code Here

Examples of org.openfaces.component.validation.ValidationProcessor

        }
    }

    private void renderClientValidatorsIfNeeded(UIComponent component, List<UIComponent> children, FacesContext context) throws IOException {
        UIForm parentForm = Components.getEnclosingForm(component);
        ValidationProcessor processor = ValidationProcessor.getInstance(context);
        ClientValidationMode validationMode = processor.getClientValidationRuleForForm(parentForm);
        if (!validationMode.equals(ClientValidationMode.OFF)) {
            renderClientValidators(parentForm, validationMode, children, context);
        }
    }
View Full Code Here

Examples of org.openfaces.component.validation.ValidationProcessor

        FloatingIconMessage fim = (FloatingIconMessage) component;

        UIComponent forComponent = getForComponent(fim);
        boolean pageDefinedMessage = !fim.isRuntimeDefined();
        ValidationProcessor validationProcessor = ValidationProcessor.getInstance(context);
        if (validationProcessor == null)
            return;


        ClientValidationMode cv = validationProcessor.getClientValidationRule(fim, forComponent);
        UIForm form = Components.getEnclosingForm(fim);
        boolean clientValidation = !cv.equals(ClientValidationMode.OFF);
        boolean useDCVP = validationProcessor.isUseDefaultClientValidationPresentationForForm(form);
        boolean useDSVP = validationProcessor.isUseDefaultServerValidationPresentationForForm(form);

        String forComponentClientId = getForComponentClientId(context, fim);
        if (forComponentClientId == null) {
            Rendering.logWarning(context, "Cannot render floatingIconMessage because can't calculate " +
                    "target component client ID. It may be caused by 'for' attribute absence");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.