Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
png
CalendarExample.png 2.9 kB 1 20-Apr-2004 18:09 MDeichsel

This page (revision-17) was last changed on 09-Mar-2006 16:11 by 192.18.1.5  

This page was created on 26-Aug-2003 11:30 by FrancoisParlant

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 18 added 38 lines
OK, sorry for taking so long. I was initially going to say that it cannot be done, but then I realized that yes, it's quite doable. It basically just requires changing the "jspwiki.tld" file to have the following:
{{{
<tag>
<name>Calendar</name>
<tagclass>com.ecyrd.jspwiki.tags.CalendarTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
<name>pageformat</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>urlformat</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>monthurlformat</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
}}}
Note that for each attribute you will have to define the "rtexprvalue" to be "true". This has now been enabled for JSPWiki 2.1.60 onwards, so you don't have to change anything if you're tracking the CVS version.
It does add some performance penalty, though.
After the change, you can do it like this:
{{{
<% String pagename = ((com.ecyrd.jspwiki.WikiContext)pageContext.getAttribute("jspwiki.context",PageContext.REQUEST_SCOPE)).getPage().getName(); %>
<wiki:Calendar pageformat="<%="'"+pagename+"_blogentry_'ddMMyy'_1'"%>"
urlformat="<%="'Wiki.jsp?page="+pagename+"&weblog.startDate='ddMMyy'&weblog.days=1'"%>"
monthurlformat="<%="'Wiki.jsp?page="+pagename+"&weblog.startDate='ddMMyy'&weblog.days=%d'"%>" />
}}}
Yup. It's extraordinarily ugly, but it works. The problem is that for some really, really strange reason (at least with JakartaTomcat 4.1) it is impossible to specify a tag within the ' -signs. It all works fine if you skip the single quotes, but those are required for the ~SimpleDateFormat.
-- JanneJalkanen
Version Date Modified Size Author Changes ... Change note
17 09-Mar-2006 16:11 7.147 kB 192.18.1.5 to previous
16 09-Mar-2006 16:10 7.093 kB 192.18.1.5 to previous | to last
15 15-Mar-2005 23:29 6.889 kB 83.131.134.241 to previous | to last
14 15-Mar-2005 23:26 6.965 kB 83.131.134.241 to previous | to last
13 21-Apr-2004 13:44 6.889 kB MDeichsel to previous | to last
12 20-Apr-2004 18:11 6.871 kB MDeichsel to previous | to last
11 20-Apr-2004 18:09 6.858 kB MDeichsel to previous | to last
10 20-Apr-2004 18:07 6.833 kB MDeichsel to previous | to last
9 18-Sep-2003 12:27 3.242 kB JanneJalkanen to previous | to last
8 17-Sep-2003 23:54 2.958 kB JoseMRus to previous | to last
7 27-Aug-2003 21:26 2.668 kB FrancoisParlant to previous | to last
6 26-Aug-2003 22:22 3.645 kB JanneJalkanen to previous | to last
5 26-Aug-2003 22:21 3.634 kB JanneJalkanen to previous | to last
4 26-Aug-2003 15:13 1.872 kB JanneJalkanen to previous | to last
3 26-Aug-2003 11:39 1.59 kB FrancoisParlant to previous | to last
2 26-Aug-2003 11:35 1.32 kB FrancoisParlant to previous | to last
1 26-Aug-2003 11:30 1.12 kB FrancoisParlant to last
« This page (revision-17) was last changed on 09-Mar-2006 16:11 by 192.18.1.5