diff options
Diffstat (limited to 'org/madore/damlengine/TodoWrefAttr.java')
-rw-r--r-- | org/madore/damlengine/TodoWrefAttr.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/org/madore/damlengine/TodoWrefAttr.java b/org/madore/damlengine/TodoWrefAttr.java index 7f40959..7f69a96 100644 --- a/org/madore/damlengine/TodoWrefAttr.java +++ b/org/madore/damlengine/TodoWrefAttr.java @@ -33,6 +33,13 @@ public class TodoWrefAttr extends TodoAttr { String wrefNumberStr = wrefMatcher.group(4); int wrefNumber = Integer.parseInt(wrefNumberStr); String wrefSupplementStr = wrefMatcher.group(5); + String wrefCat; + if ( this.owner.hasAttributeNS(DamlEngine.DAML_NS, "wrefcat") ) { + wrefCat = this.owner.getAttributeNS(DamlEngine.DAML_NS, "wrefcat"); + this.owner.removeAttributeNS(DamlEngine.DAML_NS, "wrefcat"); + } else { + wrefCat = null; + } String targetFile; String targetStdDir = (ctx.gc.uriToTop==null)?"":(ctx.gc.uriToTop+"weblog/"); WeblogSummary wsum = WeblogSummary.getSummary(); @@ -47,6 +54,10 @@ public class TodoWrefAttr extends TodoAttr { if ( ! ((wrefYearStr+"-"+wrefMonthStr+"-"+wrefDayStr) .equals(esum.date)) ) throw new IllegalArgumentException("date mismatch for reference to entry "+wrefNumberStr); + if ( wrefCat != null ) { + if ( esum.catSet == null || ! esum.catSet.contains(wrefCat) ) + throw new IllegalArgumentException("reference to entry "+wrefNumberStr+" in wrong category "+wrefCat); + } } // Choose file portion of link target if ( esum != null && esum.doSinglePage != null && ! wrefSupplementStr.equals("") ) { @@ -59,6 +70,8 @@ public class TodoWrefAttr extends TodoAttr { } else if ( ctx.wsc != null && ctx.wsc.sel != null && ctx.wsc.sel.contains(wrefNumber) ) { targetFile = ""; + } else if ( wrefCat != null ) { + targetFile = targetStdDir + wrefCat + ".html"; } else { targetFile = targetStdDir + wrefYearStr + "-" + wrefMonthStr + ".html"; if ( esum != null && esum.doSinglePage != null |