IFile referencedFile = WGADesignStructureHelper.findReferencedTMLModule(file, ref, tmlInfo.getAttributeValue("medium"));
if (referencedFile == null) {
String referencePath = new WGADesignStructureHelper(file).computeTMLModuleReferencePath(file, ref, tmlInfo.getAttributeValue("medium"));
Map<String, Object> attributes = new HashMap<String, Object>();
if (ref != null && !ref.trim().equals("")) {
if (wgaVersionIsAtLeast(5, 4) && ref.startsWith("::") && ref.toLowerCase().endsWith("@base")) {
MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "Illegal reference '" + tmlInfo.getAttributeValue("ref") + "'.", attributes);
return;
} else {
attributes.put(ATTRIBUTE_REFERENCE_TYPE, REFERENCE_TYPE_TML);
attributes.put(ATTRIBUTE_MISSING_REFERENCE_PATH, referencePath);
if (tmlInfo.getTagName().equals("portlet") || (tmlInfo.getTagName().equals("include") && tmlInfo.hasAttribute("type", "portlet"))) {
attributes.put(ATTRIBUTE_IS_PORTLET_REFERENCE, true);
} else {
attributes.put(ATTRIBUTE_IS_PORTLET_REFERENCE, false);
}
}
}
if (wgaVersionIsAtLeast(5, 4)) {
if (!referencePath.contains("@base")) {
MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "Unsatisfied reference '" + tmlInfo.getAttributeValue("ref") + "'.", attributes);
}
} else {
MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "Unsatisfied reference '" + tmlInfo.getAttributeValue("ref") + "'.", attributes);
}
}
}
}
}
// validate short tml module include syntax <tml:[modulename]>
if (wgaVersionIsAtLeast(4, 1) && tmlInfo.getTagName().matches("\\[.*\\]") && !tmlInfo.getTagName().contains("/")) {
if (!tmlInfo.hasAttribute("designdb") && !tmlInfo.isDynamicAttributeValue("medium")) {
charStart = partition.getOffset() + tmlInfo.getContent().indexOf(tmlInfo.getTagName()) + 1;
charEnd = charStart + tmlInfo.getTagName().length() - 2;
String ref = tmlInfo.getTagName().replaceAll("\\[", "");
ref = ref.replaceAll("\\]", "");
IFile referencedFile = WGADesignStructureHelper.findReferencedTMLModule(file, ref, tmlInfo.getAttributeValue("medium"));
if (referencedFile == null) {
String referencePath = new WGADesignStructureHelper(file).computeTMLModuleReferencePath(file, ref, tmlInfo.getAttributeValue("medium"));
Map<String, Object> attributes = new HashMap<String, Object>();
if (ref != null && !ref.trim().equals("")) {
if (wgaVersionIsAtLeast(5, 4) && ref.startsWith("::") && ref.toLowerCase().endsWith("@base")) {
MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "Illegal reference '" + ref + "'.", attributes);
return;