You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2024/07/07 20:33:02 UTC
(jspwiki) branch master updated (867e9b4e0 -> 6c558f378)
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
from 867e9b4e0 [maven-release-plugin] prepare for next development iteration
new 196767ef5 Update CalendarTag.java
new 9c6e10268 Update jspwiki.tld
new b677253a4 Update Sidebar.jsp
new 6c558f378 Update CalendarTag.java
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/wiki/tags/CalendarTag.java | 36 +++++++++++++++++++---
.../src/main/resources/META-INF/jspwiki.tld | 4 +++
.../src/main/webapp/templates/default/Sidebar.jsp | 4 +--
3 files changed, 38 insertions(+), 6 deletions(-)
(jspwiki) 04/04: Update CalendarTag.java
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 6c558f378cb2789627f2e6c93053d9f311187eb8
Author: udittmer <34...@users.noreply.github.com>
AuthorDate: Mon Jun 24 10:15:42 2024 +0200
Update CalendarTag.java
---
.../java/org/apache/wiki/tags/CalendarTag.java | 31 +++++++++++-----------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/tags/CalendarTag.java b/jspwiki-main/src/main/java/org/apache/wiki/tags/CalendarTag.java
index 49b5011ae..da96b48f4 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/tags/CalendarTag.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/tags/CalendarTag.java
@@ -40,8 +40,7 @@ import java.util.Date;
* Provides a nice calendar. Responds to the following HTTP parameters:
* <ul>
* <li>calendar.date - If this parameter exists, then the calendar
- * date is taken from the month and year. The date must be in ddMMyy
- * format.
+ * date is taken from the month and year. The date must be in ddMMyy format.
* <li>weblog.startDate - If calendar.date parameter does not exist,
* we then check this date.
* </ul>
@@ -57,7 +56,7 @@ public class CalendarTag extends WikiTagBase {
private static final long serialVersionUID = 0L;
private static final Logger LOG = LogManager.getLogger( CalendarTag.class );
- private static final int NUM_PAGES_TO_CHECK = 5;
+ private static final int NUM_PAGES_TO_CHECK = 3;
private SimpleDateFormat m_pageFormat;
private SimpleDateFormat m_urlFormat;
@@ -161,19 +160,19 @@ public class CalendarTag extends WikiTagBase {
if( m_pageFormat != null ) {
final String pagename = m_pageFormat.format( day.getTime() );
- var somePageExistsOnThisDay = false;
- if (m_addIndex) {
- // Look at up to 5 pages for whether the page exists. This avoids an issue
- // with the WeblogPlugin when the first blog post(s) of a day gets deleted.
- for (int pageIdx = 1; pageIdx <= NUM_PAGES_TO_CHECK; pageIdx++) {
- if( engine.getManager( PageManager.class ).wikiPageExists( pagename+pageIdx ) ) {
- somePageExistsOnThisDay = true;
- break;
- }
- }
- } else {
- somePageExistsOnThisDay = engine.getManager( PageManager.class ).wikiPageExists( pagename );
- }
+ var somePageExistsOnThisDay = false;
+ if (m_addIndex) {
+ // Look at up to 3 pages for whether the page exists. This avoids an issue
+ // with the WeblogPlugin when the first blog post(s) of a day gets deleted.
+ for (int pageIdx = 1; pageIdx <= NUM_PAGES_TO_CHECK; pageIdx++) {
+ if( engine.getManager( PageManager.class ).wikiPageExists( pagename+pageIdx ) ) {
+ somePageExistsOnThisDay = true;
+ break;
+ }
+ }
+ } else {
+ somePageExistsOnThisDay = engine.getManager( PageManager.class ).wikiPageExists( pagename );
+ }
if( somePageExistsOnThisDay ) {
if( m_urlFormat != null ) {
(jspwiki) 01/04: Update CalendarTag.java
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 196767ef5c865fce2e7e63e682a620fc44203ed4
Author: udittmer <34...@users.noreply.github.com>
AuthorDate: Mon Jun 24 10:04:00 2024 +0200
Update CalendarTag.java
---
.../java/org/apache/wiki/tags/CalendarTag.java | 33 ++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/tags/CalendarTag.java b/jspwiki-main/src/main/java/org/apache/wiki/tags/CalendarTag.java
index 51cda55db..49b5011ae 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/tags/CalendarTag.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/tags/CalendarTag.java
@@ -57,10 +57,12 @@ public class CalendarTag extends WikiTagBase {
private static final long serialVersionUID = 0L;
private static final Logger LOG = LogManager.getLogger( CalendarTag.class );
+ private static final int NUM_PAGES_TO_CHECK = 5;
private SimpleDateFormat m_pageFormat;
private SimpleDateFormat m_urlFormat;
private SimpleDateFormat m_monthUrlFormat;
+ private boolean m_addIndex;
private SimpleDateFormat m_dateFormat = new SimpleDateFormat( "ddMMyy" );
/**
@@ -127,6 +129,19 @@ public class CalendarTag extends WikiTagBase {
m_monthUrlFormat = new SimpleDateFormat( format );
}
+ /**
+ * Sets whether or not the pageFormat contains a page index at the end.
+ * This is the case for the WeblogPlugin.
+ *
+ * @param addindex Whether a page index should be appended to the pageFormat
+ *
+ * @see org.apache.wiki.plugin.WeblogPlugin
+ */
+ public void setAddindex( final boolean addIndex )
+ {
+ m_addIndex = addIndex;
+ }
+
private String format( final String txt ) {
final Page p = m_wikiContext.getPage();
if( p != null ) {
@@ -145,8 +160,22 @@ public class CalendarTag extends WikiTagBase {
if( m_pageFormat != null ) {
final String pagename = m_pageFormat.format( day.getTime() );
-
- if( engine.getManager( PageManager.class ).wikiPageExists( pagename ) ) {
+
+ var somePageExistsOnThisDay = false;
+ if (m_addIndex) {
+ // Look at up to 5 pages for whether the page exists. This avoids an issue
+ // with the WeblogPlugin when the first blog post(s) of a day gets deleted.
+ for (int pageIdx = 1; pageIdx <= NUM_PAGES_TO_CHECK; pageIdx++) {
+ if( engine.getManager( PageManager.class ).wikiPageExists( pagename+pageIdx ) ) {
+ somePageExistsOnThisDay = true;
+ break;
+ }
+ }
+ } else {
+ somePageExistsOnThisDay = engine.getManager( PageManager.class ).wikiPageExists( pagename );
+ }
+
+ if( somePageExistsOnThisDay ) {
if( m_urlFormat != null ) {
final String url = m_urlFormat.format( day.getTime() );
result = "<td class=\"link\"><a href=\""+url+"\">"+day.get( Calendar.DATE )+"</a></td>";
(jspwiki) 02/04: Update jspwiki.tld
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 9c6e10268bfeaf8a081441be237cb51e51917043
Author: udittmer <34...@users.noreply.github.com>
AuthorDate: Mon Jun 24 10:04:46 2024 +0200
Update jspwiki.tld
---
jspwiki-main/src/main/resources/META-INF/jspwiki.tld | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/jspwiki-main/src/main/resources/META-INF/jspwiki.tld b/jspwiki-main/src/main/resources/META-INF/jspwiki.tld
index 90ae4dbfe..15e8c8480 100644
--- a/jspwiki-main/src/main/resources/META-INF/jspwiki.tld
+++ b/jspwiki-main/src/main/resources/META-INF/jspwiki.tld
@@ -97,6 +97,10 @@
<name>monthurlformat</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
+ <attribute>
+ <name>addindex</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
</tag>
<tag>
(jspwiki) 03/04: Update Sidebar.jsp
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit b677253a460d12aa28707cac8588b5e782192b61
Author: udittmer <34...@users.noreply.github.com>
AuthorDate: Mon Jun 24 10:05:32 2024 +0200
Update Sidebar.jsp
---
jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp b/jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp
index b465eec36..fd79e854b 100644
--- a/jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp
@@ -29,7 +29,7 @@
<c:set var="isweblog"><%= ( String )Context.findContext( pageContext ).getPage().getAttribute( /*ATTR_ISWEBLOG*/ "weblogplugin.isweblog" ) %></c:set>
<c:if test="${isweblog}">
- <wiki:Calendar pageformat="'${param.page}_blogentry_'ddMMyy'_1'"
+ <wiki:Calendar pageformat="'${param.page}_blogentry_'ddMMyy'_'" addindex="true"
urlformat="'Wiki.jsp?page=${param.page}&weblog.startDate='ddMMyy'&weblog.days=1'"/>
</c:if>
@@ -63,4 +63,4 @@
<div class="wikiversion text-center"><%=Release.APPNAME%> v<wiki:Variable var="jspwikiversion" /> <wiki:RSSImageLink title='<%=LocaleSupport.getLocalizedMessage(pageContext,"fav.aggregatewiki.title")%>' /></div>
--%>
-</div>
\ No newline at end of file
+</div>