*
* @throws ProcessingException if the current document cannot be opened.
*/
public Document[] getInternalReferences() throws ProcessingException {
ArrayList unpublishedReferences = new ArrayList();
SiteTree sitetree;
Pattern internalLinkPattern = getInternalLinkPattern();
Publication publication = pageEnvelope.getPublication();
DocumentBuilder builder = publication.getDocumentBuilder();
try {
sitetree = publication.getSiteTree(Publication.LIVE_AREA);
String[] internalLinks =
Grep.findPattern(
pageEnvelope.getDocument().getFile(),
internalLinkPattern,
1);
String[] internalLinksLanguages =
Grep.findPattern(
pageEnvelope.getDocument().getFile(),
internalLinkPattern,
2);
for (int i = 0; i < internalLinks.length; i++) {
String docId = internalLinks[i];
String language = null;
log.debug("docId: " + docId);
if (internalLinksLanguages[i] != null) {
// trim the leading '_'
language = internalLinksLanguages[i].substring(1);
}
log.debug("language: " + language);
SiteTreeNode documentNode = sitetree.getNode(docId);
if (language == null) {
String url =
"/"
+ publication.getId()