if (cachedUri != null) { return cachedUri; } else if (referenceType.equals(T2ReferenceType.ReferenceSet)) { try { URI result = new URI("t2:ref//" + namespacePart + "?" return null; } else if (referenceType.equals(T2ReferenceType.IdentifiedList)) { try { URI result = new URI("t2:list//" + namespacePart + "?" return null; } else if (referenceType.equals(T2ReferenceType.ErrorDocument)) { try { URI result = new URI("t2:error//" + namespacePart + "?"
+ reference.getReferenceType().toString()); return new JTextArea( "Reference Service failed to obtain the data to render: data is not a ReferenceSet");
if (cachedUri != null) { return cachedUri; } else if (referenceType.equals(T2ReferenceType.ReferenceSet)) { try { URI result = new URI("t2:ref//" + namespacePart + "?" return null; } else if (referenceType.equals(T2ReferenceType.IdentifiedList)) { try { URI result = new URI("t2:list//" + namespacePart + "?" return null; } else if (referenceType.equals(T2ReferenceType.ErrorDocument)) { try { URI result = new URI("t2:error//" + namespacePart + "?"
+ reference.getReferenceType().toString()); return new JTextArea( "Reference Service failed to obtain the data to render: data is not a ReferenceSet");
private Set<T2Reference> getErrors(T2Reference ref) { Set<T2Reference> result = new HashSet<T2Reference>(); if (ref.getReferenceType().equals(ReferenceSet)) { // nothing } else if (ref.getReferenceType().equals(IdentifiedList)) { IdentifiedList<T2Reference> originalList = listService.getList(ref); for (T2Reference subValue : originalList) if (subValue.containsErrors()) result.addAll(getErrors(subValue)); } else { result.add(ref); } return result; }
+ reference.getReferenceType().toString()); return new JTextArea( "Reference Service failed to obtain the data to render: data is not a ReferenceSet");
private T2Reference findFirstFailure(T2Reference value) { IdentifiedList<T2Reference> originalList = listService.getList(value); for (T2Reference subValue : originalList) { if (subValue.getReferenceType().equals(ErrorDocument)) return subValue; if (subValue.getReferenceType().equals(IdentifiedList)) if (subValue.containsErrors()) return findFirstFailure(subValue); // No need to consider value } return null; }
if (referenceType.equals(T2ReferenceType.ReferenceSet)) { try { result = new URI("t2:ref//" + getNamespacePart() + "?" + getLocalPart()); logger.error("Unable to create URI", e); } else if (referenceType.equals(T2ReferenceType.IdentifiedList)) { try { result = new URI("t2:list//" + getNamespacePart() + "?" + getLocalPart() + "/" logger.error("Unable to create URI", e); } else if (referenceType.equals(T2ReferenceType.ErrorDocument)) { try { result = new URI("t2:error//" + getNamespacePart() + "?" + getLocalPart() + "/"
public static List<ErrorDocument> getErrorDocuments(T2Reference reference, ReferenceService referenceService) { List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>(); if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = referenceService .getErrorDocumentService(); errorDocuments.add(errorDocumentService.getError(reference)); } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { ListService listService = referenceService.getListService(); IdentifiedList<T2Reference> list = listService.getList(reference); for (T2Reference listReference : list) { errorDocuments .addAll(getErrorDocuments(listReference, referenceService)); } } return errorDocuments; }
public static List<ErrorDocument> getErrorDocuments(T2Reference reference, ReferenceService referenceService) { List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>(); if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = referenceService .getErrorDocumentService(); errorDocuments.add(errorDocumentService.getError(reference)); } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { ListService listService = referenceService.getListService(); IdentifiedList<T2Reference> list = listService.getList(reference); for (T2Reference listReference : list) { errorDocuments .addAll(getErrorDocuments(listReference, referenceService)); } } return errorDocuments; }
public static List<ErrorDocument> getErrorDocuments(T2Reference reference, InvocationContext context) { List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>(); if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = context.getReferenceService().getErrorDocumentService(); errorDocuments.add(errorDocumentService.getError(reference)); } else if (reference.getReferenceType().equals(T2ReferenceType.IdentifiedList)) { ListService listService = context.getReferenceService().getListService(); IdentifiedList<T2Reference> list = listService.getList(reference); for (T2Reference listReference : list) { errorDocuments.addAll(getErrorDocuments(listReference, context)); } } return errorDocuments; }
if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = context.getReferenceService().getErrorDocumentService(); ErrorDocument causeErrorDocument = errorDocumentService.getError(reference); buildErrorDocumentTree(child, causeErrorDocument, context); } else if (reference.getReferenceType().equals(T2ReferenceType.IdentifiedList)) { List<ErrorDocument> errorDocuments = getErrorDocuments(reference, context); if (errorDocuments.size() == 1) {
if (reference.getReferenceType().equals( T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = referenceService buildErrorDocumentTree(child, causeErrorDocument, referenceService); } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { List<ErrorDocument> errorDocuments = getErrorDocuments(
if (reference.getReferenceType().equals( T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = referenceService buildErrorDocumentTree(child, causeErrorDocument, referenceService); } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { List<ErrorDocument> errorDocuments = getErrorDocuments(
if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocument error = referenceService.getErrorDocumentService() .getError(reference); messageElement.addContent(error.getExceptionMessage()); element.addContent(messageElement); } else if (reference.getReferenceType().equals( T2ReferenceType.ReferenceSet)) { element.setName("referenceSet"); } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { IdentifiedList<T2Reference> list = referenceService
int listCounter = 0; for (T2Reference reference : errorReferences) { if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = context.getReferenceService().getErrorDocumentService(); ErrorDocument causeErrorDocument = errorDocumentService.getError(reference); } else if (reference.getReferenceType().equals(T2ReferenceType.IdentifiedList)) { List<ErrorDocument> errorDocuments = getErrorDocuments(reference, context); errDocumentString += "ErrorDocument list " + (++listCounter) + "\n";
int listCounter = 0; for (T2Reference reference : errorReferences) { if (reference.getReferenceType().equals( T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = context causeErrorDocument, context) + "\n"; } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { List<ErrorDocument> errorDocuments = getErrorDocuments(
/** * Drill inside an error document reference to get the error one deeper than * this as long as it is at least depth 1. */ T2ReferenceImpl getDeeperErrorReference() { if (getReferenceType().equals(T2ReferenceType.ErrorDocument)) { if (getDepth() == 0) { throw new AssertionError("Error identifier already has depth 0, cannot decrease"); } T2ReferenceImpl result = new T2ReferenceImpl(); result.setContainsErrors(true); result.setDepth(getDepth() - 1); result.setLocalPart(getLocalPart()); result.setNamespacePart(getNamespacePart()); result.setReferenceType(T2ReferenceType.ErrorDocument); return result; } throw new AssertionError( "Attempt to get a deeper reference on something that isn't an error ref"); }
public boolean delete( IdentifiedList<T2Reference> theList) throws DaoException { if (theList.getId() == null) { throw new DaoException("Supplied list set has a null ID, allocate " + "an ID before calling the store method in the dao."); } else if (theList.getId().getReferenceType().equals( T2ReferenceType.IdentifiedList) == false) { throw new DaoException("Strangely the list ID doesn't have type " + "T2ReferenceType.IdentifiedList, something has probably " + "gone badly wrong somewhere earlier!"); } if (theList instanceof T2ReferenceListImpl) { try { sessionFactory.getCurrentSession().delete(theList); } catch (Exception ex) { throw new DaoException(ex); } } else { throw new DaoException( "Supplied identifier list not an instance of T2ReferenceList"); } return true; }
int listCounter = 0; for (T2Reference reference : errorReferences) { if (reference.getReferenceType().equals( T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = context causeErrorDocument, context) + "\n"; } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { List<ErrorDocument> errorDocuments = getErrorDocuments(