*/
public TACPatternsSection(Composite parent, int style,
DeviceEditorContext context) {
super(parent, style);
this.context = context;
ODOMElement identificationRootElement =
(ODOMElement) context.getDeviceRepositoryAccessorManager().
getDeviceTACIdentificationDocument().getRootElement();
try {
context.addRootElement(identificationRootElement,
identificationRootElement.getName());
context.addSupplementaryValidator(new DOMSupplementaryValidatorDetails(
MCSNamespace.DEVICE_TAC_IDENTIFICATION.getURI(),
DeviceRepositorySchemaConstants.NUMBER_ELEMENT_NAME,
new TACNumberValidator()));
// Censor xsd generated errors on the number element
// of the TAC document since the error messages bear no relation
// to what is shown in the gui.
// todo remove this when validation is updated to provide good error messages.
MarkerGeneratingErrorReporter errorReporter =
context.getErrorReporter((ODOMElement) context.
getDeviceRepositoryAccessorManager().
getDeviceTACIdentificationDocument().getRootElement());
errorReporter.censor(DeviceRepositorySchemaConstants.
DEVICE_ELEMENT_NAME +
":" + DeviceRepositorySchemaConstants.NUMBER_ELEMENT_NAME,
FaultTypes.INVALID_SCHEMA_PATTERN_VALUE);
errorReporter.censor(DeviceRepositorySchemaConstants.
DEVICE_ELEMENT_NAME +
":" + DeviceRepositorySchemaConstants.NUMBER_ELEMENT_NAME,
FaultTypes.INVALID_ELEMENT_CONTENT);
errorReporter.putMessageKeyMapping(INVALID_TAC_NUMBER,
MarkerGeneratingErrorReporter.MESSAGE_KEY_PREFIX +
"invalidTACNumber");
context.addRootElement(identificationRootElement,
identificationRootElement.getName());
LocationDetailsRegistry registry =
errorReporter.getLocationDetailsRegistry();
if (registry == null) {
registry = new LocationDetailsRegistry();