protected void transformXML (Document doc,
String childId, short childType, String childName,
Map parameters)
throws Exception {
DOMUtil du = new DOMUtil();
// Replace id
du.setElementValue(doc, "/article/meta/id", childId);
// Replace editor
org.apache.lenya.cms.ac.Identity identity = (org.apache.lenya.cms.ac.Identity)parameters.get("org.apache.lenya.cms.ac.Identity");
du.setElementValue(doc, "/article/meta/editor", identity.getUsername());
Calendar cal = new GregorianCalendar();
// Replace year
du.setElementValue(doc, "/article/meta/date/year",
Integer.toString(cal.get(Calendar.YEAR)));
// Replace month
int month = cal.get(Calendar.MONTH) + 1;
du.setElementValue(doc, "/article/meta/date/month",
Integer.toString(month));
du.setAttributeValue(doc, "/article/meta/date/month/@name",
DateUtil.getMonthName(month));
// Replace day
du.setElementValue(doc, "/article/meta/date/day",
Integer.toString(cal.get(Calendar.DAY_OF_MONTH)));
du.setAttributeValue(doc, "/article/meta/date/day/@name",
DateUtil.getDayName(cal.get(Calendar.DAY_OF_WEEK)));
// Replace hour
du.setElementValue(doc, "/article/meta/date/hour",
DateUtil.oneToTwoDigits(Integer.toString(cal.get(Calendar.HOUR_OF_DAY))));
// Replace minute
du.setElementValue(doc, "/article/meta/date/minute",
DateUtil.oneToTwoDigits(Integer.toString(cal.get(Calendar.MINUTE))));
}