Class S2SValidatorServiceImpl

java.lang.Object
org.kuali.coeus.s2sgen.impl.validate.S2SValidatorServiceImpl
All Implemented Interfaces:
S2SValidatorService

@Component("s2SValidatorService") public class S2SValidatorServiceImpl extends Object implements S2SValidatorService
This class validates a XML document passed as XMLObject
Author:
Kuali Research Administration Team (kualidev@oncourse.iu.edu)
  • Constructor Details

    • S2SValidatorServiceImpl

      public S2SValidatorServiceImpl()
  • Method Details

    • validateForm

      public ValidationResult validateForm(org.apache.xmlbeans.XmlObject formObject, String formName)
      This method receives an XMLObject and validates it against its schema and returns the validation result. It also receives a list in which upon validation failure, populates it with XPaths of the error nodes.
      Specified by:
      validateForm in interface S2SValidatorService
      Parameters:
      formObject - XML document as XmlObject
      formName - is the FormName.
      Returns:
      validation result true if valid false otherwise.
    • validateApplication

      public ValidationResult validateApplication(String applicationXml, org.springframework.core.io.Resource oppSchemaResource)
      Description copied from interface: S2SValidatorService
      This method receives a full s2s application and the url to a schema and validates the application against the schema. Failure to retrieve the schema or a malformed schema will not cause a failure.
      Specified by:
      validateApplication in interface S2SValidatorService
    • validateXml

      protected boolean validateXml(org.apache.xmlbeans.XmlObject formObject, List<String> errors)
      This method receives an XMLObject and validates it against its schema and returns the validation result. It also receives a list in which upon validation failure, populates it with XPaths of the error nodes
      Parameters:
      formObject - XML document as XmlObject
      errors - List of XPaths of the error nodes.
      Returns:
      validation result true if valid false otherwise.
    • getXPath

      protected String getXPath(Node node)
      This method receives a node, fetches its name, and recurses up to its parent node, until it reaches the document node, thus creating the XPath of the node passed and returns it as String
      Parameters:
      node - for which Document node has to found.
      Returns:
      String which represents XPath of the node
    • getS2SErrorHandlerService

      public S2SErrorHandlerService getS2SErrorHandlerService()
    • setS2SErrorHandlerService

      public void setS2SErrorHandlerService(S2SErrorHandlerService s2SErrorHandlerService)
    • getCatalog

      public org.springframework.core.io.Resource getCatalog()
    • setCatalog

      public void setCatalog(org.springframework.core.io.Resource catalog)
    • getApprovedSchemaProtocols

      public Set<String> getApprovedSchemaProtocols()
    • setApprovedSchemaProtocols

      public void setApprovedSchemaProtocols(Set<String> approvedSchemaProtocols)
    • getApprovedSchemaPrefixes

      public Set<String> getApprovedSchemaPrefixes()
    • setApprovedSchemaPrefixes

      public void setApprovedSchemaPrefixes(Set<String> approvedSchemaPrefixes)