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)
-
Field Summary
Fields inherited from interface org.kuali.coeus.s2sgen.impl.validate.S2SValidatorService
GRANTS_GOV_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.io.Resourceprotected StringThis 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 StringvoidsetApprovedSchemaPrefixes(Set<String> approvedSchemaPrefixes) voidsetApprovedSchemaProtocols(Set<String> approvedSchemaProtocols) voidsetCatalog(org.springframework.core.io.Resource catalog) voidsetS2SErrorHandlerService(S2SErrorHandlerService s2SErrorHandlerService) validateApplication(String applicationXml, org.springframework.core.io.Resource oppSchemaResource) This method receives a full s2s application and the url to a schema and validates the application against the schema.validateForm(org.apache.xmlbeans.XmlObject formObject, String formName) This method receives an XMLObject and validates it against its schema and returns the validation result.protected booleanvalidateXml(org.apache.xmlbeans.XmlObject formObject, List<String> errors) This method receives an XMLObject and validates it against its schema and returns the validation result.
-
Constructor Details
-
S2SValidatorServiceImpl
public S2SValidatorServiceImpl()
-
-
Method Details
-
validateForm
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:
validateFormin interfaceS2SValidatorService- Parameters:
formObject- XML document asXmlObjectformName- 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:S2SValidatorServiceThis 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:
validateApplicationin interfaceS2SValidatorService
-
validateXml
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 asXmlObjecterrors-Listof XPaths of the error nodes.- Returns:
- validation result true if valid false otherwise.
-
getXPath
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
-
setS2SErrorHandlerService
-
getCatalog
public org.springframework.core.io.Resource getCatalog() -
setCatalog
public void setCatalog(org.springframework.core.io.Resource catalog) -
getApprovedSchemaProtocols
-
setApprovedSchemaProtocols
-
getApprovedSchemaPrefixes
-
setApprovedSchemaPrefixes
-