Update of /cvsroot/roller/roller/src/org/roller/presentation/weblog/tags
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29660/src/org/roller/presentation/weblog/tags
Modified Files:
BigWeblogCalendarModel.java WeblogCalendarModel.java
ApplyPluginsTag.java EditWeblogCalendarModel.java
Log Message:
More I18N work and UI cleanup
Index: BigWeblogCalendarModel.java
===================================================================
RCS file:
/cvsroot/roller/roller/src/org/roller/presentation/weblog/tags/BigWeblogCalendarModel.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** BigWeblogCalendarModel.java 1 Feb 2004 03:23:58 -0000 1.15
--- BigWeblogCalendarModel.java 28 Feb 2004 23:23:25 -0000 1.16
***************
*** 1,258 ****
! package org.roller.presentation.weblog.tags;
!
! import org.roller.pojos.WeblogEntryData;
! import org.roller.presentation.RollerContext;
! import org.roller.presentation.RollerRequest;
! import org.roller.presentation.tags.calendar.CalendarModel;
! import org.roller.util.DateUtil;
!
! import java.text.ParsePosition;
! import java.text.SimpleDateFormat;
! import java.util.Calendar;
! import java.util.Date;
! import java.util.List;
! import java.util.Map;
!
! import javax.servlet.http.HttpServletRequest;
! import javax.servlet.http.HttpServletResponse;
!
!
! /**
! * Model for big calendar that displays titles for each day.
! * @author David M Johnson
! */
! public class BigWeblogCalendarModel implements CalendarModel
! {
! protected HttpServletRequest mReq = null;
! protected HttpServletResponse mRes = null;
! protected Map mMonthMap;
! protected String mSelfUrl;
! protected Date mDay;
! protected String mCatName = null;
!
! protected static SimpleDateFormat mStarDateFormat =
! DateUtil.get8charDateFormat();
!
! protected static SimpleDateFormat mSingleDayFormat =
! new SimpleDateFormat("dd");
!
!
! public BigWeblogCalendarModel(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! mReq = req;
! mRes = res;
! mSelfUrl = url;
!
! // If category is specified in URL, then perpetuate it
! String catKey = RollerRequest.WEBLOGCATEGORYNAME_KEY;
! mCatName = mReq.getParameter(catKey);
! if ( mCatName != null )
! {
! mCatName = "?"+catKey+"="+mCatName;
! }
! else
! {
! mCatName = "";
! }
! }
!
! public static BigWeblogCalendarModel getInstance(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! return new BigWeblogCalendarModel(req, res, url);
! }
!
! public void setDay(Date month) throws Exception
! {
! mDay = month;
!
! // If category is specified in URL, then use it
! String catName =
! mReq.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
!
! mMonthMap = RollerRequest.getRollerRequest(mReq)
! .getWeblogEntryMonthMap( month, catName, false, true );
! }
!
! public void setDay(String month) throws Exception
! {
! ParsePosition pos = new ParsePosition(0);
! setDay( mStarDateFormat.parse( month, pos ) );
! }
!
! public Date getDay()
! {
! return mDay;
! }
!
! public String getSelfUrl() throws Exception
! {
! return mRes.encodeURL(mSelfUrl);
! }
!
! public String getTargetUrl() throws Exception
! {
! return getSelfUrl();
! }
!
! // public String getParameterName()
! // {
! // return RollerRequest.WEBLOGDAY_KEY;
! // }
! //
! // The type of the object in mMonthMap is WebLogEntryData. This method was
never
! // used so it was commented out.
! //
! // public String getParameterValue( Date day )
! // {
! // return (String)mMonthMap.get( day );
! // }
!
! /**
! * Create URL for use on view-weblog page, ignores query-string.
! * @param day Day for URL
! * @param valid Always return a URL, never return null
! * @return URL for day, or null if no weblog entry on that day
! */
! public String computeUrl(Date day, boolean valid)
! {
! String url = null;
! try
! {
! if ( day == null )
! {
! url = mRes.encodeURL(mSelfUrl + mCatName);
! }
! else
! {
! // get the 8 char YYYYMMDD datestring for day, returns null
! // if no weblog entry on that day
! String dateString = null;
! List entries =
! (List)mMonthMap.get( day );
! if ( entries != null && day != null )
! {
! WeblogEntryData entry = (WeblogEntryData)entries.get(0);
! dateString =
! mStarDateFormat.format(entry.getPubTime());
!
! // append 8 char date string on end of selfurl
! url = mRes.encodeURL(mSelfUrl+"/"+dateString+mCatName);
! }
! else if ( entries != null )
! {
! url = mRes.encodeURL(mSelfUrl+"/"+mCatName);
! }
! else if ( valid )
! {
! // Make the date yyyyMMdd and append it to URL
! dateString = mStarDateFormat.format( day );
! url = mRes.encodeURL(mSelfUrl+"/"+dateString+mCatName);
! }
! }
! }
! catch (Exception e)
! {
! RollerRequest.getRollerRequest(mReq)
! .getServletContext().log("ERROR: creating URL",e);
! }
! return url;
! }
!
! /**
! * @see
org.roller.presentation.tags.calendar.CalendarModel#getContent(Date, boolean)
! */
! public String getContent(Date day)
! {
! String content = null;
! try
! {
! RollerRequest rreq =
RollerRequest.getRollerRequest(mReq);
! RollerContext rctx =
!
RollerContext.getRollerContext(rreq.getServletContext());
! StringBuffer sb = new StringBuffer();
!
! // get the 8 char YYYYMMDD datestring for day, returns null
! // if no weblog entry on that day
! String dateString = null;
! List entries = (List)mMonthMap.get(day);
! if ( entries != null )
! {
! dateString = mStarDateFormat.format(
! ((WeblogEntryData)entries.get(0)).getPubTime());
!
! // append 8 char date string on end of selfurl
! String dayUrl = mRes.encodeURL(mSelfUrl+"/"+
dateString+mCatName );
!
! sb.append("<div class=\"hCalendarDayTitleBig\">");
! sb.append("<a href=\"");
! sb.append( dayUrl );
! sb.append("\">");
! sb.append( mSingleDayFormat.format( day ) );
! sb.append("</a></div>");
!
! for ( int i=0; i<entries.size(); i++ )
! {
! sb.append("<div class=\"bCalendarDayContentBig\">");
! sb.append("<a href=\"");
! sb.append(rctx.createEntryPermalink(
! (WeblogEntryData)entries.get(i),mReq,false));
! sb.append("\">");
!
! String title =
((WeblogEntryData)entries.get(i)).getTitle().trim();
! if ( title.length()==0 )
! {
! title = ((WeblogEntryData)entries.get(i)).getAnchor();
! }
! if ( title.length() > 20 )
! {
! title = title.substring(0,20)+"...";
! }
!
! sb.append( title );
! sb.append("</a></div>");
! }
!
! }
! else
! {
! sb.append("<div class=\"hCalendarDayTitleBig\">");
! sb.append( mSingleDayFormat.format( day ) );
! sb.append("</div>");
! sb.append("<div class=\"bCalendarDayContentBig\"/>");
! }
! content = sb.toString();
! }
! catch (Exception e)
! {
! RollerRequest.getRollerRequest(mReq)
! .getServletContext().log("ERROR: creating URL",e);
! }
! return content;
! }
!
! public String computeNextMonthUrl()
! {
! // Create yyyyMMdd dates for next month, prev month and today
! Calendar nextCal = Calendar.getInstance();
! nextCal.setTime( mDay );
! nextCal.add( Calendar.MONTH, 1 );
! String nextMonth = computeUrl(nextCal.getTime(),true);
! return nextMonth;
! }
!
! public String computePrevMonthUrl()
! {
! Calendar prevCal = Calendar.getInstance();
! prevCal.setTime( mDay );
! prevCal.add( Calendar.MONTH, -1 );
! String prevMonth = computeUrl(prevCal.getTime(),true);
! return prevMonth;
! }
!
! public String computeTodayMonthUrl()
! {
! return computeUrl(null,true);
! }
! }
--- 1,265 ----
! package org.roller.presentation.weblog.tags;
!
! import org.roller.model.WeblogManager;
! import org.roller.pojos.WeblogEntryData;
! import org.roller.presentation.RollerContext;
! import org.roller.presentation.RollerRequest;
! import org.roller.presentation.tags.calendar.CalendarModel;
! import org.roller.util.DateUtil;
!
! import java.text.ParsePosition;
! import java.text.SimpleDateFormat;
! import java.util.Calendar;
! import java.util.Date;
! import java.util.List;
! import java.util.Map;
!
! import javax.servlet.http.HttpServletRequest;
! import javax.servlet.http.HttpServletResponse;
!
!
! /**
! * Model for big calendar that displays titles for each day.
! * @author David M Johnson
! */
! public class BigWeblogCalendarModel implements CalendarModel
! {
! protected HttpServletRequest mReq = null;
! protected HttpServletResponse mRes = null;
! protected Map mMonthMap;
! protected String mSelfUrl;
! protected Date mDay;
! protected String mCatName = null;
!
! protected static SimpleDateFormat mStarDateFormat =
! DateUtil.get8charDateFormat();
!
! protected static SimpleDateFormat mSingleDayFormat =
! new SimpleDateFormat("dd");
!
!
! public BigWeblogCalendarModel(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! mReq = req;
! mRes = res;
! mSelfUrl = url;
!
! // If category is specified in URL, then perpetuate it
! String catKey = RollerRequest.WEBLOGCATEGORYNAME_KEY;
! mCatName = mReq.getParameter(catKey);
! if ( mCatName != null )
! {
! mCatName = "?"+catKey+"="+mCatName;
! }
! else
! {
! mCatName = "";
! }
! }
!
! public static BigWeblogCalendarModel getInstance(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! return new BigWeblogCalendarModel(req, res, url);
! }
!
! public void setDay(Date month) throws Exception
! {
! mDay = month;
!
! // If category is specified in URL, then use it
! String catName =
! mReq.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
!
! RollerRequest rreq = RollerRequest.getRollerRequest(mReq);
! WeblogManager mgr = rreq.getRoller().getWeblogManager();
! mMonthMap = mgr.getWeblogEntryMonthMap(
! rreq.getUser().getUserName(),
! month,
! catName,
! false,
! true );
! }
!
! public void setDay(String month) throws Exception
! {
! ParsePosition pos = new ParsePosition(0);
! setDay( mStarDateFormat.parse( month, pos ) );
! }
!
! public Date getDay()
! {
! return mDay;
! }
!
! public String getSelfUrl() throws Exception
! {
! return mRes.encodeURL(mSelfUrl);
! }
!
! public String getTargetUrl() throws Exception
! {
! return getSelfUrl();
! }
!
! // public String getParameterName()
! // {
! // return RollerRequest.WEBLOGDAY_KEY;
! // }
! //
! // The type of the object in mMonthMap is WebLogEntryData. This method was
never
! // used so it was commented out.
! //
! // public String getParameterValue( Date day )
! // {
! // return (String)mMonthMap.get( day );
! // }
!
! /**
! * Create URL for use on view-weblog page, ignores query-string.
! * @param day Day for URL
! * @param valid Always return a URL, never return null
! * @return URL for day, or null if no weblog entry on that day
! */
! public String computeUrl(Date day, boolean valid)
! {
! String url = null;
! try
! {
! if ( day == null )
! {
! url = mRes.encodeURL(mSelfUrl + mCatName);
! }
! else
! {
! // get the 8 char YYYYMMDD datestring for day, returns null
! // if no weblog entry on that day
! String dateString = null;
! List entries =
! (List)mMonthMap.get( day );
! if ( entries != null && day != null )
! {
! WeblogEntryData entry = (WeblogEntryData)entries.get(0);
! dateString =
! mStarDateFormat.format(entry.getPubTime());
!
! // append 8 char date string on end of selfurl
! url = mRes.encodeURL(mSelfUrl+"/"+dateString+mCatName);
! }
! else if ( entries != null )
! {
! url = mRes.encodeURL(mSelfUrl+"/"+mCatName);
! }
! else if ( valid )
! {
! // Make the date yyyyMMdd and append it to URL
! dateString = mStarDateFormat.format( day );
! url = mRes.encodeURL(mSelfUrl+"/"+dateString+mCatName);
! }
! }
! }
! catch (Exception e)
! {
! RollerRequest.getRollerRequest(mReq)
! .getServletContext().log("ERROR: creating URL",e);
! }
! return url;
! }
!
! /**
! * @see
org.roller.presentation.tags.calendar.CalendarModel#getContent(Date, boolean)
! */
! public String getContent(Date day)
! {
! String content = null;
! try
! {
! RollerRequest rreq =
RollerRequest.getRollerRequest(mReq);
! RollerContext rctx =
!
RollerContext.getRollerContext(rreq.getServletContext());
! StringBuffer sb = new StringBuffer();
!
! // get the 8 char YYYYMMDD datestring for day, returns null
! // if no weblog entry on that day
! String dateString = null;
! List entries = (List)mMonthMap.get(day);
! if ( entries != null )
! {
! dateString = mStarDateFormat.format(
! ((WeblogEntryData)entries.get(0)).getPubTime());
!
! // append 8 char date string on end of selfurl
! String dayUrl = mRes.encodeURL(mSelfUrl+"/"+
dateString+mCatName );
!
! sb.append("<div class=\"hCalendarDayTitleBig\">");
! sb.append("<a href=\"");
! sb.append( dayUrl );
! sb.append("\">");
! sb.append( mSingleDayFormat.format( day ) );
! sb.append("</a></div>");
!
! for ( int i=0; i<entries.size(); i++ )
! {
! sb.append("<div class=\"bCalendarDayContentBig\">");
! sb.append("<a href=\"");
! sb.append(rctx.createEntryPermalink(
! (WeblogEntryData)entries.get(i),mReq,false));
! sb.append("\">");
!
! String title =
((WeblogEntryData)entries.get(i)).getTitle().trim();
! if ( title.length()==0 )
! {
! title = ((WeblogEntryData)entries.get(i)).getAnchor();
! }
! if ( title.length() > 20 )
! {
! title = title.substring(0,20)+"...";
! }
!
! sb.append( title );
! sb.append("</a></div>");
! }
!
! }
! else
! {
! sb.append("<div class=\"hCalendarDayTitleBig\">");
! sb.append( mSingleDayFormat.format( day ) );
! sb.append("</div>");
! sb.append("<div class=\"bCalendarDayContentBig\"/>");
! }
! content = sb.toString();
! }
! catch (Exception e)
! {
! RollerRequest.getRollerRequest(mReq)
! .getServletContext().log("ERROR: creating URL",e);
! }
! return content;
! }
!
! public String computeNextMonthUrl()
! {
! // Create yyyyMMdd dates for next month, prev month and today
! Calendar nextCal = Calendar.getInstance();
! nextCal.setTime( mDay );
! nextCal.add( Calendar.MONTH, 1 );
! String nextMonth = computeUrl(nextCal.getTime(),true);
! return nextMonth;
! }
!
! public String computePrevMonthUrl()
! {
! Calendar prevCal = Calendar.getInstance();
! prevCal.setTime( mDay );
! prevCal.add( Calendar.MONTH, -1 );
! String prevMonth = computeUrl(prevCal.getTime(),true);
! return prevMonth;
! }
!
! public String computeTodayMonthUrl()
! {
! return computeUrl(null,true);
! }
! }
Index: WeblogCalendarModel.java
===================================================================
RCS file:
/cvsroot/roller/roller/src/org/roller/presentation/weblog/tags/WeblogCalendarModel.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** WeblogCalendarModel.java 1 Feb 2004 03:23:58 -0000 1.15
--- WeblogCalendarModel.java 28 Feb 2004 23:23:25 -0000 1.16
***************
*** 1,173 ****
!
! package org.roller.presentation.weblog.tags;
!
! import org.roller.presentation.RollerRequest;
! import org.roller.presentation.tags.calendar.CalendarModel;
! import org.roller.util.DateUtil;
!
! import java.text.ParsePosition;
! import java.text.SimpleDateFormat;
! import java.util.Calendar;
! import java.util.Date;
! import java.util.Map;
!
! import javax.servlet.http.HttpServletRequest;
! import javax.servlet.http.HttpServletResponse;
!
! /**
! * Calendar model for calendar intended for use on view-weblog page.
! */
! public class WeblogCalendarModel implements CalendarModel
! {
! protected HttpServletRequest mReq = null;
! protected HttpServletResponse mRes = null;
! protected Map mMonthMap;
! protected String mSelfUrl;
! protected Date mDay;
! protected String mCatName = null;
!
! public WeblogCalendarModel(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! mReq = req;
! mRes = res;
! mSelfUrl = url;
!
! // If category is specified in URL, then perpetuate it
! String catKey = RollerRequest.WEBLOGCATEGORYNAME_KEY;
! mCatName = mReq.getParameter(catKey);
! if ( mCatName != null )
! {
! mCatName = "?"+catKey+"="+mCatName;
! }
! else
! {
! mCatName = "";
! }
! }
!
! public static WeblogCalendarModel getInstance(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! return new WeblogCalendarModel(req, res, url);
! }
!
! public void setDay(Date month) throws Exception
! {
! mDay = month;
!
! // If category is specified in URL, then use it
! String catName =
! mReq.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
!
! // we want dayOnly and pubOnly
! mMonthMap = RollerRequest.getRollerRequest(mReq)
! .getWeblogEntryMonthMap( month, catName, true, true );
! }
!
! public void setDay(String month) throws Exception
! {
! SimpleDateFormat fmt = DateUtil.get8charDateFormat();
! ParsePosition pos = new ParsePosition(0);
! setDay( fmt.parse( month, pos ) );
! }
!
! public Date getDay()
! {
! return mDay;
! }
!
! public String getSelfUrl() throws Exception
! {
! return mRes.encodeURL(mSelfUrl);
! }
!
! public String getTargetUrl() throws Exception
! {
! return getSelfUrl();
! }
!
! public String getParameterName()
! {
! return RollerRequest.WEBLOGDAY_KEY;
! }
!
! public String getParameterValue( Date day )
! {
! return (String)mMonthMap.get( day );
! }
!
! /**
! * Create URL for use on view-weblog page, ignores query-string.
! * @param day Day for URL
! * @param valid Always return a URL, never return null
! * @return URL for day, or null if no weblog entry on that day
! */
! public String computeUrl(java.util.Date day, boolean valid)
! {
! String url = null;
! RollerRequest rreq = RollerRequest.getRollerRequest(mReq);
! try
! {
! if ( day == null )
! {
! url = mRes.encodeURL(mSelfUrl + mCatName);
! }
! else
! {
! // get the 8 char YYYYMMDD datestring for day, returns null
! // if no weblog entry on that day
! String dateString = (String)mMonthMap.get( day );
! if ( dateString != null )
! {
! // append 8 char date string on end of selfurl
! url = mRes.encodeURL(mSelfUrl+"/"+dateString+mCatName);
! }
! else if ( valid )
! {
! // Make the date yyyyMMdd and append it to URL
! dateString = DateUtil.format8chars( day );
! url = mRes.encodeURL( mSelfUrl+"/"+dateString+mCatName);
! }
! }
! }
! catch (Exception e)
! {
! rreq.getServletContext().log("ERROR: creating URL",e);
! }
! return url;
! }
!
! /**
! * @see
org.roller.presentation.tags.calendar.CalendarModel#getContent(Date, boolean)
! */
! public String getContent(Date day)
! {
! return null;
! }
!
! public String computeNextMonthUrl()
! {
! // Create yyyyMMdd dates for next month, prev month and today
! Calendar nextCal = Calendar.getInstance();
! nextCal.setTime( mDay );
! nextCal.add( Calendar.MONTH, 1 );
! String nextMonth = computeUrl(nextCal.getTime(),true);
! return nextMonth;
! }
!
! public String computePrevMonthUrl()
! {
! Calendar prevCal = Calendar.getInstance();
! prevCal.setTime( mDay );
! prevCal.add( Calendar.MONTH, -1 );
! String prevMonth = computeUrl(prevCal.getTime(),true);
! return prevMonth;
! }
!
! public String computeTodayMonthUrl()
! {
! return computeUrl(null,true);
! }
! }
!
--- 1,180 ----
!
! package org.roller.presentation.weblog.tags;
!
! import org.roller.model.WeblogManager;
! import org.roller.presentation.RollerRequest;
! import org.roller.presentation.tags.calendar.CalendarModel;
! import org.roller.util.DateUtil;
!
! import java.text.ParsePosition;
! import java.text.SimpleDateFormat;
! import java.util.Calendar;
! import java.util.Date;
! import java.util.Map;
!
! import javax.servlet.http.HttpServletRequest;
! import javax.servlet.http.HttpServletResponse;
!
! /**
! * Calendar model for calendar intended for use on view-weblog page.
! */
! public class WeblogCalendarModel implements CalendarModel
! {
! protected HttpServletRequest mReq = null;
! protected HttpServletResponse mRes = null;
! protected Map mMonthMap;
! protected String mSelfUrl;
! protected Date mDay;
! protected String mCatName = null;
!
! public WeblogCalendarModel(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! mReq = req;
! mRes = res;
! mSelfUrl = url;
!
! // If category is specified in URL, then perpetuate it
! String catKey = RollerRequest.WEBLOGCATEGORYNAME_KEY;
! mCatName = mReq.getParameter(catKey);
! if ( mCatName != null )
! {
! mCatName = "?"+catKey+"="+mCatName;
! }
! else
! {
! mCatName = "";
! }
! }
!
! public static WeblogCalendarModel getInstance(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! return new WeblogCalendarModel(req, res, url);
! }
!
! public void setDay(Date month) throws Exception
! {
! mDay = month;
!
! // If category is specified in URL, then use it
! String catName =
! mReq.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
!
! // we want dayOnly and pubOnly
! RollerRequest rreq = RollerRequest.getRollerRequest(mReq);
! WeblogManager mgr = rreq.getRoller().getWeblogManager();
! mMonthMap = mgr.getWeblogEntryMonthMap(
! rreq.getUser().getUserName(),
! month,
! catName,
! true,
! true );
! }
!
! public void setDay(String month) throws Exception
! {
! SimpleDateFormat fmt = DateUtil.get8charDateFormat();
! ParsePosition pos = new ParsePosition(0);
! setDay( fmt.parse( month, pos ) );
! }
!
! public Date getDay()
! {
! return mDay;
! }
!
! public String getSelfUrl() throws Exception
! {
! return mRes.encodeURL(mSelfUrl);
! }
!
! public String getTargetUrl() throws Exception
! {
! return getSelfUrl();
! }
!
! public String getParameterName()
! {
! return RollerRequest.WEBLOGDAY_KEY;
! }
!
! public String getParameterValue( Date day )
! {
! return (String)mMonthMap.get( day );
! }
!
! /**
! * Create URL for use on view-weblog page, ignores query-string.
! * @param day Day for URL
! * @param valid Always return a URL, never return null
! * @return URL for day, or null if no weblog entry on that day
! */
! public String computeUrl(java.util.Date day, boolean valid)
! {
! String url = null;
! RollerRequest rreq = RollerRequest.getRollerRequest(mReq);
! try
! {
! if ( day == null )
! {
! url = mRes.encodeURL(mSelfUrl + mCatName);
! }
! else
! {
! // get the 8 char YYYYMMDD datestring for day, returns null
! // if no weblog entry on that day
! String dateString = (String)mMonthMap.get( day );
! if ( dateString != null )
! {
! // append 8 char date string on end of selfurl
! url = mRes.encodeURL(mSelfUrl+"/"+dateString+mCatName);
! }
! else if ( valid )
! {
! // Make the date yyyyMMdd and append it to URL
! dateString = DateUtil.format8chars( day );
! url = mRes.encodeURL( mSelfUrl+"/"+dateString+mCatName);
! }
! }
! }
! catch (Exception e)
! {
! rreq.getServletContext().log("ERROR: creating URL",e);
! }
! return url;
! }
!
! /**
! * @see
org.roller.presentation.tags.calendar.CalendarModel#getContent(Date, boolean)
! */
! public String getContent(Date day)
! {
! return null;
! }
!
! public String computeNextMonthUrl()
! {
! // Create yyyyMMdd dates for next month, prev month and today
! Calendar nextCal = Calendar.getInstance();
! nextCal.setTime( mDay );
! nextCal.add( Calendar.MONTH, 1 );
! String nextMonth = computeUrl(nextCal.getTime(),true);
! return nextMonth;
! }
!
! public String computePrevMonthUrl()
! {
! Calendar prevCal = Calendar.getInstance();
! prevCal.setTime( mDay );
! prevCal.add( Calendar.MONTH, -1 );
! String prevMonth = computeUrl(prevCal.getTime(),true);
! return prevMonth;
! }
!
! public String computeTodayMonthUrl()
! {
! return computeUrl(null,true);
! }
! }
!
Index: ApplyPluginsTag.java
===================================================================
RCS file:
/cvsroot/roller/roller/src/org/roller/presentation/weblog/tags/ApplyPluginsTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ApplyPluginsTag.java 28 Feb 2004 05:05:48 -0000 1.1
--- ApplyPluginsTag.java 28 Feb 2004 23:23:25 -0000 1.2
***************
*** 76,80 ****
/**
* Maximum length of text displayed, only applies if stripHtml is true.
! * @jsp.attribute required="true"
* @return Returns the maxLength.
*/
--- 76,80 ----
/**
* Maximum length of text displayed, only applies if stripHtml is true.
! * @jsp.attribute required="false"
* @return Returns the maxLength.
*/
***************
*** 95,99 ****
/**
* Set to true to strip all HTML markup from output.
! * @jsp.attribute required="true"
* @return Returns the stripHtml.
*/
--- 95,99 ----
/**
* Set to true to strip all HTML markup from output.
! * @jsp.attribute required="false"
* @return Returns the stripHtml.
*/
Index: EditWeblogCalendarModel.java
===================================================================
RCS file:
/cvsroot/roller/roller/src/org/roller/presentation/weblog/tags/EditWeblogCalendarModel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** EditWeblogCalendarModel.java 1 Feb 2004 03:23:58 -0000 1.9
--- EditWeblogCalendarModel.java 28 Feb 2004 23:23:25 -0000 1.10
***************
*** 1,116 ****
!
! package org.roller.presentation.weblog.tags;
!
! import org.roller.presentation.RollerRequest;
! import org.roller.presentation.tags.menu.RollerMenuModel;
! import org.roller.util.DateUtil;
!
! import java.util.Date;
!
! import javax.servlet.http.HttpServletRequest;
! import javax.servlet.http.HttpServletResponse;
!
! /**
! * Calendar model for calendar intended for use on edit-weblog page.
! */
! public class EditWeblogCalendarModel extends WeblogCalendarModel
! {
! protected String mQueryString = null;
!
! /**
! * @param req
! * @param resp
! * @param selfUrl
! * @param queryString */
! public EditWeblogCalendarModel(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! super( req, res, url );
! }
!
! public void setDay(Date month) throws Exception
! {
! mDay = month;
!
! // If category is specified in URL, then use it
! String catName =
! mReq.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
!
! // we want dayOnly but not pubOnly
! mMonthMap = RollerRequest.getRollerRequest(mReq)
! .getWeblogEntryMonthMap( month, catName, true, false );
! }
!
! /**
! * Create URL for use on edit-weblog page, preserves the request
! * parameters used by the tabbed-menu tag for navigation.
! *
! * @param day Day for URL
! * @param valid Always return a URL, never return null
! * @return URL for day, or null if no weblog entry on that day
! */
! public String computeUrl( java.util.Date day, boolean valid )
! {
! String url = null;
! try
! {
! boolean haveWeblogEntry = true;
!
! if ( day == null )
! {
! url = mRes.encodeURL(mSelfUrl + mCatName);
! }
! else
! {
! // get the 8 char YYYYMMDD datestring for day, returns null
! // if no weblog entry on that day
! String dateString = (String)mMonthMap.get( day );
!
! if ( dateString == null )
! {
! haveWeblogEntry = false;
!
! // no weblog entry and no date, so use today as the date
! dateString = DateUtil.format8chars( day );
! }
!
! if ( haveWeblogEntry || valid )
! {
! // create URL with params for day, menu, and menu item
! StringBuffer sb = new StringBuffer();
! sb.append( mSelfUrl );
!
! sb.append( '&' );
! sb.append( RollerRequest.WEBLOGDAY_KEY);
! sb.append( '=' );
! sb.append( dateString );
!
! //sb.append( "&method=edit" );
!
! if (mReq.getParameter(RollerMenuModel.MENU_KEY) != null )
! {
! sb.append( '&' );
! sb.append( RollerMenuModel.MENU_KEY );
! sb.append( '=' );
!
sb.append(mReq.getParameter(RollerMenuModel.MENU_KEY));
! }
! if
(mReq.getParameter(RollerMenuModel.MENU_ITEM_KEY)!=null)
! {
! sb.append( '&' );
! sb.append( RollerMenuModel.MENU_ITEM_KEY );
! sb.append( '=' );
! sb.append(
!
mReq.getParameter(RollerMenuModel.MENU_ITEM_KEY));
! }
! url = mRes.encodeURL( sb.toString() );
! }
! }
! }
! catch (Exception e)
! {
!
RollerRequest.getRollerRequest(mReq).getServletContext().log("ERROR: creating
URL",e);
! }
! return url;
! }
! }
!
--- 1,124 ----
!
! package org.roller.presentation.weblog.tags;
!
! import org.roller.model.WeblogManager;
! import org.roller.presentation.RollerRequest;
! import org.roller.presentation.tags.menu.RollerMenuModel;
! import org.roller.util.DateUtil;
!
! import java.util.Date;
!
! import javax.servlet.http.HttpServletRequest;
! import javax.servlet.http.HttpServletResponse;
!
! /**
! * Calendar model for calendar intended for use on edit-weblog page.
! */
! public class EditWeblogCalendarModel extends WeblogCalendarModel
! {
! protected String mQueryString = null;
!
! /**
! * @param req
! * @param resp
! * @param selfUrl
! * @param queryString */
! public EditWeblogCalendarModel(
! HttpServletRequest req, HttpServletResponse res, String url)
! {
! super( req, res, url );
! }
!
! public void setDay(Date month) throws Exception
! {
! mDay = month;
!
! // If category is specified in URL, then use it
! String catName =
! mReq.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
!
! // we want dayOnly but not pubOnly
! RollerRequest rreq = RollerRequest.getRollerRequest(mReq);
! WeblogManager mgr = rreq.getRoller().getWeblogManager();
! mMonthMap = mgr.getWeblogEntryMonthMap(
! rreq.getUser().getUserName(),
! month,
! catName,
! true,
! false );
!
! }
!
! /**
! * Create URL for use on edit-weblog page, preserves the request
! * parameters used by the tabbed-menu tag for navigation.
! *
! * @param day Day for URL
! * @param valid Always return a URL, never return null
! * @return URL for day, or null if no weblog entry on that day
! */
! public String computeUrl( java.util.Date day, boolean valid )
! {
! String url = null;
! try
! {
! boolean haveWeblogEntry = true;
!
! if ( day == null )
! {
! url = mRes.encodeURL(mSelfUrl + mCatName);
! }
! else
! {
! // get the 8 char YYYYMMDD datestring for day, returns null
! // if no weblog entry on that day
! String dateString = (String)mMonthMap.get( day );
!
! if ( dateString == null )
! {
! haveWeblogEntry = false;
!
! // no weblog entry and no date, so use today as the date
! dateString = DateUtil.format8chars( day );
! }
!
! if ( haveWeblogEntry || valid )
! {
! // create URL with params for day, menu, and menu item
! StringBuffer sb = new StringBuffer();
! sb.append( mSelfUrl );
!
! sb.append( '&' );
! sb.append( RollerRequest.WEBLOGDAY_KEY);
! sb.append( '=' );
! sb.append( dateString );
!
! //sb.append( "&method=edit" );
!
! if (mReq.getParameter(RollerMenuModel.MENU_KEY) != null )
! {
! sb.append( '&' );
! sb.append( RollerMenuModel.MENU_KEY );
! sb.append( '=' );
!
sb.append(mReq.getParameter(RollerMenuModel.MENU_KEY));
! }
! if
(mReq.getParameter(RollerMenuModel.MENU_ITEM_KEY)!=null)
! {
! sb.append( '&' );
! sb.append( RollerMenuModel.MENU_ITEM_KEY );
! sb.append( '=' );
! sb.append(
!
mReq.getParameter(RollerMenuModel.MENU_ITEM_KEY));
! }
! url = mRes.encodeURL( sb.toString() );
! }
! }
! }
! catch (Exception e)
! {
!
RollerRequest.getRollerRequest(mReq).getServletContext().log("ERROR: creating
URL",e);
! }
! return url;
! }
! }
!
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
|