public class DefaultAuditReportXSDGenerationService extends java.lang.Object implements AuditReportXSDGenerationService
AuditReportXSDGenerationService| Constructor and Description |
|---|
DefaultAuditReportXSDGenerationService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addMandatoryAttributes(Type auditConfigType,
TopLevelComplexType complexType,
java.util.List<Type> allTypes,
Schema schema)
Added tne mandatory attribute for the type system item model attribute into the complex type.
|
protected void |
addUniqueAttributes(Type auditConfigType,
TopLevelComplexType complexType)
First, Java primitive type is added as unique attribute if there is no unique attribute is defined in audit report config.
|
protected void |
buildAtomicAttributes(Type auditConfigType,
TopLevelComplexType complexType)
Build the atomic attributes into the given complex type for audit config type
|
protected void |
buildComplexType(java.util.List<Type> allTypes,
Schema schema,
Type auditConfigType)
Build the complex type from given audit config type, and add into the given schema
|
protected TopLevelComplexType |
buildLocalizedHybrisField()
Build the localized hybris field complex type.
|
protected void |
buildReferenceAttributes(Type auditConfigType,
TopLevelComplexType complexType)
Build the reference attributes into the given complex type for audit config type
|
protected void |
buildRelationAttributes(Type auditConfigType,
TopLevelComplexType complexType)
Build the relation attributes into the given complex type for audit config type
|
protected TopLevelElement |
buildRootElement(AuditReportConfig auditReportConfig)
Build root level element by given audit report config.
|
protected TopLevelComplexType |
buildSimpleHybrisField()
Build the simple hybris field complex type.
|
protected void |
buildVirtualAttributes(Type auditConfigType)
Log the virtual attribute is not added, and not supported yet.
|
protected java.lang.String |
cleanXSD(java.lang.String xsdString)
Remove the empty xmlns if exists.
|
protected LocalElement |
createAtomicAttributeElement(AttributeDescriptorModel attr,
Type type)
Create LocalElement object for atomic attribute.
|
protected Attribute |
createAttribute(java.lang.String name,
java.lang.String type)
build an attribute element.
|
protected LocalElement |
createElement(java.lang.String name,
java.lang.String type,
boolean isMany,
boolean isUnique)
Create a local element object from the ObjectFactory with given name, type
|
protected Keybase |
createKeybase(java.lang.String type,
java.lang.String attr)
Create a keybase element by given type and attribute.
|
protected java.util.List<AttributeDescriptorModel> |
findMandatoryAttributes(Type auditConfigType,
java.lang.String typeCode)
Return the list of AttributeDescriptorModel which is mandatory by given audit config type and type code.
|
protected java.util.List<AttributeDescriptorModel> |
findUniqueAttributes(Type auditConfigType,
java.lang.String typeCode)
Return the list of AttributeDescriptorModel which is unique by given audit config type and type code.
|
java.lang.String |
generate(java.lang.String auditConfigName)
Genreate the XSD string.
|
protected AuditConfigService |
getAuditConfigService() |
protected TypeService |
getTypeService() |
protected boolean |
hasUniqueAttribute(TopLevelComplexType complexType)
Check if the given complex type has the unique constraint.
|
protected boolean |
isAtomicAttribute(java.lang.String attributeTypeCode)
Return if the given attribute type code is an atomic attribute.
|
protected boolean |
isAttributeInAuditConfig(Type auditConfigType,
AttributeDescriptorModel attr)
check if the given type attribute is defined in audit config type.
|
protected boolean |
isRequiredMandatoryAttribute(AttributeDescriptorModel attr)
The mandatory attributes need to be persisted, without default value, not PK.
|
protected boolean |
isTypeCodeInAuditConfig(java.util.List<Type> allTypes,
java.lang.String typeCode)
If the given typeCode exists in AuditReportConfig.
|
protected boolean |
isTypeCodeInSchema(Schema schema,
java.lang.String typeCode)
If the given typeCode exists in given schema.
|
protected java.lang.String |
marshaller(Schema schema)
Marshaller the given schema to xsd output.
|
void |
setAuditConfigService(AuditConfigService auditConfigService) |
void |
setTypeService(TypeService typeService) |
protected java.lang.String |
uniqueKey(java.lang.String type,
java.lang.String attr)
Generate the uniqueKey name string.
|
public DefaultAuditReportXSDGenerationService()
public java.lang.String generate(java.lang.String auditConfigName)
throws javax.xml.bind.JAXBException
AuditReportXSDGenerationServicegenerate in interface AuditReportXSDGenerationServiceauditConfigName - the audit config namejavax.xml.bind.JAXBException - exceptionprotected TopLevelElement buildRootElement(AuditReportConfig auditReportConfig)
auditReportConfig - the audit report configprotected void buildComplexType(java.util.List<Type> allTypes, Schema schema, Type auditConfigType)
allTypes - the all types from the auditReportConfigschema - the schema objectauditConfigType - the audit config typeprotected void buildVirtualAttributes(Type auditConfigType)
auditConfigType - audit config typeprotected void buildAtomicAttributes(Type auditConfigType, TopLevelComplexType complexType)
auditConfigType - audit config typecomplexType - complex typeprotected void buildReferenceAttributes(Type auditConfigType, TopLevelComplexType complexType)
auditConfigType - audit config typecomplexType - complex typeprotected void buildRelationAttributes(Type auditConfigType, TopLevelComplexType complexType)
auditConfigType - audit config typecomplexType - complex typeprotected java.lang.String marshaller(Schema schema) throws javax.xml.bind.JAXBException
schema - schemajavax.xml.bind.JAXBException - exceptionprotected java.lang.String cleanXSD(java.lang.String xsdString)
xsdString - XSDprotected void addUniqueAttributes(Type auditConfigType, TopLevelComplexType complexType)
auditConfigType - the audit config typecomplexType - the top level complex typeprotected void addMandatoryAttributes(Type auditConfigType, TopLevelComplexType complexType, java.util.List<Type> allTypes, Schema schema)
auditConfigType - audit config typecomplexType - the complex typeallTypes - the all types from audit configschema - the schemaprotected boolean isAtomicAttribute(java.lang.String attributeTypeCode)
attributeTypeCode - attribute type codeprotected java.util.List<AttributeDescriptorModel> findUniqueAttributes(Type auditConfigType, java.lang.String typeCode)
auditConfigType - audit config typetypeCode - type codeprotected java.util.List<AttributeDescriptorModel> findMandatoryAttributes(Type auditConfigType, java.lang.String typeCode)
auditConfigType - audit config typetypeCode - type codeprotected boolean isTypeCodeInAuditConfig(java.util.List<Type> allTypes, java.lang.String typeCode)
allTypes - all types in AuditReportConfigtypeCode - the type codeprotected boolean isTypeCodeInSchema(Schema schema, java.lang.String typeCode)
schema - generated schematypeCode - the type codeprotected boolean isAttributeInAuditConfig(Type auditConfigType, AttributeDescriptorModel attr)
auditConfigType - the audit config typeattr - the type system attribute modelprotected boolean isRequiredMandatoryAttribute(AttributeDescriptorModel attr)
attr - AttributeDescriptorModelprotected boolean hasUniqueAttribute(TopLevelComplexType complexType)
complexType - complex typeprotected LocalElement createElement(java.lang.String name, java.lang.String type, boolean isMany, boolean isUnique)
name - element nametype - element typeisMany - is the element is collectionisUnique - is the element has unique constraintprotected LocalElement createAtomicAttributeElement(AttributeDescriptorModel attr, Type type)
attr - the attribute description modeltype - the type object of the AuditConfigTypeprotected Keybase createKeybase(java.lang.String type, java.lang.String attr)
type - type codeattr - attribute nameprotected java.lang.String uniqueKey(java.lang.String type,
java.lang.String attr)
type - uniquekey typeattr - uniquekey attribute nameprotected TopLevelComplexType buildSimpleHybrisField()
protected TopLevelComplexType buildLocalizedHybrisField()
protected Attribute createAttribute(java.lang.String name, java.lang.String type)
name - attribute nametype - attribute typeprotected TypeService getTypeService()
public void setTypeService(TypeService typeService)
protected AuditConfigService getAuditConfigService()
public void setAuditConfigService(AuditConfigService auditConfigService)
Copyright © 2018 SAP SE. All Rights Reserved.