You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "Glen Mazza (JIRA)" <ji...@apache.org> on 2013/01/08 00:02:12 UTC

[jira] [Updated] (ROL-1780) SiteModel.getNewWeblogs javadoc fix, functionality improvement and patch

     [ https://issues.apache.org/jira/browse/ROL-1780?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Glen Mazza updated ROL-1780:
----------------------------

    Summary: SiteModel.getNewWeblogs javadoc fix, functionality improvement and patch  (was: SiteModel.getNewWeblogs javadoc fix, functionality improovement and patch)
    
> SiteModel.getNewWeblogs javadoc fix, functionality improvement and patch
> ------------------------------------------------------------------------
>
>                 Key: ROL-1780
>                 URL: https://issues.apache.org/jira/browse/ROL-1780
>             Project: Roller
>          Issue Type: Improvement
>    Affects Versions: 4.0.1
>            Reporter: Manos Batsis
>            Assignee: Roller Unassigned
>            Priority: Minor
>         Attachments: ROL-1780.patch.txt, sitemodel_getNewWeblogs_roller5trunk_patch.txt
>
>
> The patch that follows fixes the method's javadoc and adds the ability to just retrieve a list of blogs if the number of days is a negative integer
> Index: /Users/manos/lib/roller_4.1/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java
> ===================================================================
> --- /Users/manos/lib/roller_4.1/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java	(revision 735639)
> +++ /Users/manos/lib/roller_4.1/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java	(working copy)
> @@ -391,14 +391,19 @@
>      /*
>       * Get most collection of Website objects,
>       * in reverse chrono order by creationDate.
> -     * @param offset   Offset into results (for paging)
> -     * @param len      Max number of results to return
> +     * @param sinceDays   What "new" means in days
> +     * @param length      Max number of results to return
>       */
>      public List getNewWeblogs(int sinceDays, int length) {
>          List results = new ArrayList();
> -        Calendar cal = Calendar.getInstance();
> -        cal.setTime(new Date());
> -        cal.add(Calendar.DATE, -1 * sinceDays);
> +    	Calendar cal = Calendar.getInstance();
> +        if(sinceDays < 0){
> +        	cal.set(1970, 0, 1);
> +        }
> +        else{
> +            cal.setTime(new Date());
> +            cal.add(Calendar.DATE, -1 * sinceDays);
> +        }
>          Date startDate = cal.getTime();
>          try {            
>              Weblogger roller = WebloggerFactory.getWeblogger();

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira