Changeset 18180 for trunk

Show
Ignore:
Timestamp:
10/06/08 14:16:01 (3 months ago)
Author:
avinash
Message:

blog:
- modified blog filter as per new screen shots on wiki page
- added start and end date selection fields to choose dates using calendar for filter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/net/project/view/components/BlogArchives.java

    r18109 r18180  
    99import java.util.Date; 
    1010import java.util.List; 
     11import java.util.StringTokenizer; 
    1112 
    1213import net.project.base.PnWebloggerException; 
     
    2526import org.apache.tapestry.annotations.Inject; 
    2627import org.apache.tapestry.annotations.InjectPage; 
     28import org.apache.tapestry.annotations.Persist; 
    2729import org.apache.tapestry.annotations.SetupRender; 
    2830import org.apache.tapestry.ioc.services.PropertyAccess; 
     
    6870        private String jSPRootURL; 
    6971         
    70         private List<BlogArchives> archivesList
     72        private List<BlogArchives> archivesListForDaysAndPost
    7173         
    7274        private DateFormat userDateFormat; 
    7375         
    7476        private String monthFormatPattern; 
    75  
     77         
     78        private String daysTokens = "1,3,7,15,30,90"; 
     79         
     80        private String postsTokens = "20,50,100,500"; 
     81         
     82        private String commaSeparator = ""; 
     83         
    7684        public BlogArchives() { 
    7785                log = Logger.getLogger(BlogArchives.class); 
     
    118126                setModuleId(viewBlog.getModuleId()); 
    119127                 
    120                 if(firstEntryDate != null && lastEntryDate != null){             
    121                         // generating filter list 
    122                         archivesList = generateArchiveListFilter(firstEntryDate, lastEntryDate, WeblogConstants.DATE_RANGE_FOR_ARCHIVES, 7); 
    123                 } 
    124                 if(archivesList != null && archivesList.size() > 0){ 
    125                         blogArchive = archivesList.get(0); 
     128                if(firstEntryDate != null && lastEntryDate != null){ 
     129                        Calendar cal1 = Calendar.getInstance(); 
     130                        cal1.setTime(firstEntryDate); 
     131                        cal1.set(Calendar.HOUR, 0); 
     132                        cal1.set(Calendar.MINUTE, 0); 
     133                        cal1.set(Calendar.SECOND, 0); 
     134                        cal1.set(Calendar.MILLISECOND, 0); 
     135                         
     136                        Calendar cal2 = Calendar.getInstance(); 
     137                        cal2.setTime(lastEntryDate); 
     138                        cal2.set(Calendar.HOUR, 0); 
     139                        cal2.set(Calendar.MINUTE, 0); 
     140                        cal2.set(Calendar.SECOND, 0); 
     141                        cal2.set(Calendar.MILLISECOND, 0); 
     142                        cal2.add(Calendar.DATE, 1); 
     143                        archivesListForDaysAndPost = generateArchiveListFilterForDaysAndPosts(firstEntryDate, cal2.getTime()); 
     144                } 
     145                if( archivesListForDaysAndPost != null && archivesListForDaysAndPost.size() > 0){ 
     146                        blogArchive = archivesListForDaysAndPost.get(0); 
    126147                } else { 
    127                         archivesList = new ArrayList<BlogArchives>(); 
     148                        archivesListForDaysAndPost = new ArrayList<BlogArchives>(); 
    128149                        blogArchive = new BlogArchives(); 
    129150                        blogArchive.setLinkDisplayName("No Blogs"); 
    130151                        blogArchive.setLinkHrefValue("0"); 
    131                         archivesList.add(blogArchive); 
    132                 } 
    133                 archiveBeans = new GenericSelectModel<BlogArchives>(archivesList, BlogArchives.class, "linkDisplayName", "linkHrefValue", access); 
     152                        archivesListForDaysAndPost.add(blogArchive); 
     153                } 
    134154        } 
    135155         
     
    137157         * @param firstEntryDate 
    138158         * @param lastEntryDate 
    139          * @param dateRange 
    140          * @param filterOptions 
    141159         * @return 
    142160         */ 
    143         private List<BlogArchives> generateArchiveListFilter(Date firstEntryDate, Date lastEntryDate, Integer dateRange, int filterOptions)
     161        private List<BlogArchives> generateArchiveListFilterForDaysAndPosts(Date firstEntryDate, Date lastEntryDate)
    144162                List<BlogArchives> filterList = new ArrayList<BlogArchives>(); 
    145                 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy"); 
    146                 BlogArchives linkProperty = null; 
    147                 Calendar cal1 = Calendar.getInstance(); 
    148                 cal1.set(Calendar.HOUR, 0); 
    149                 cal1.set(Calendar.MINUTE, 0); 
    150                 cal1.set(Calendar.SECOND, 0); 
    151                 cal1.set(Calendar.MILLISECOND, 0); 
    152                 cal1.add(Calendar.DATE, 1); 
     163                List<BlogArchives> filterListOfPosts = new ArrayList<BlogArchives>(); 
     164                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); 
     165                StringTokenizer token = new     StringTokenizer(daysTokens,","); 
     166                Integer days = null; 
     167                while(token.hasMoreTokens()){ 
     168                        days = Integer.valueOf(token.nextToken()); 
     169                        Calendar cal1 = Calendar.getInstance(); 
     170                        cal1.set(Calendar.HOUR, 0); 
     171                        cal1.set(Calendar.MINUTE, 0); 
     172                        cal1.set(Calendar.SECOND, 0); 
     173                        cal1.set(Calendar.MILLISECOND, 0); 
     174                        cal1.add(Calendar.DATE, -days); 
     175                        if(isBlogEntriesExistBetween(cal1.getTime(),lastEntryDate)){ 
     176                                if(filterList.size() == 0){ 
     177                                        filterList.add(addLinkProperty("all",simpleDateFormat.format(firstEntryDate)+"-"+simpleDateFormat.format(lastEntryDate),true)); 
     178                                        filterList.add(addLinkProperty(" last ","",false)); 
     179                                } 
     180                                filterList.add(addLinkProperty(days+"",simpleDateFormat.format(cal1.getTime())+"-"+simpleDateFormat.format(lastEntryDate),true)); 
     181                        } 
     182                } 
     183                if(filterList != null && filterList.size() > 0){ 
     184                        filterList.add(addLinkProperty(" days, ","0",false)); 
     185                } 
    153186                 
    154                 Calendar cal2 = Calendar.getInstance(); 
    155                 cal2.set(Calendar.HOUR, 0); 
    156                 cal2.set(Calendar.MINUTE, 0); 
    157                 cal2.set(Calendar.SECOND, 0); 
    158                 cal2.set(Calendar.MILLISECOND, 0); 
    159                 cal2.set(Calendar.DAY_OF_MONTH, cal1.getActualMinimum(Calendar.DAY_OF_MONTH));  
     187                StringTokenizer postsToken = new StringTokenizer(postsTokens,","); 
     188                int prevPost = 0; 
     189                int curPost = 0; 
     190                while(postsToken.hasMoreTokens()){ 
     191                        curPost = Integer.parseInt(postsToken.nextToken()); 
     192                        if (userWeblogEntries != null && userWeblogEntries.size() >= prevPost){ 
     193                                filterListOfPosts.add(addLinkProperty(curPost+"",""+curPost,true)); 
     194                        } 
     195                        prevPost = curPost; 
     196                } 
     197                if(filterListOfPosts != null && filterListOfPosts.size() > 0){ 
     198                        filterListOfPosts.add(addLinkProperty(" posts","0",false)); 
     199                } 
     200                        filterList.addAll(filterListOfPosts); 
     201                return filterList; 
     202        } 
     203         
     204        public BlogArchives addLinkProperty(String name,String link,boolean isLink){ 
     205                BlogArchives linkProperty = new BlogArchives(); 
     206                linkProperty.setLinkDisplayName(name); 
     207                linkProperty.setLinkHrefValue(link); 
     208                linkProperty.setIsArchivesLinks(isLink); 
     209                if(isLink == true && (!name.equals(daysTokens.split(",")[daysTokens.split(",").length-1])  
     210                                && !name.equals(postsTokens.split(",")[postsTokens.split(",").length-1]))) { 
     211                        linkProperty.setCommaSeparator(", "); 
     212                } 
     213                return linkProperty; 
     214        } 
    160215                 
    161                 int daysInMonth = 0; 
    162                 while(cal2.before(cal1)){ 
    163                         daysInMonth ++; 
    164                         cal2.add(Calendar.DATE, 1); 
    165                 } 
    166                 if(daysInMonth < dateRange && filterOptions > 1){ 
    167                         cal2.add(Calendar.DATE, -dateRange); 
    168                         if(isBlogEntriesExistBetween(cal2.getTime(), cal1.getTime())){ 
    169                                 Calendar lastDate = Calendar.getInstance(); 
    170                                 lastDate.setTime(cal2.getTime()); 
    171                                 Calendar now = Calendar.getInstance(); 
    172                                 now.setTime(cal1.getTime()); 
    173                                 now.add(Calendar.DATE, -1); 
    174                                 if( filterList.size() == 0){ 
    175                                         linkProperty = new BlogArchives(); 
    176                                         linkProperty.setLinkDisplayName("Last 7 days"); 
    177                                         linkProperty.setLinkHrefValue(simpleDateFormat.format(cal2.getTime())+"/"+simpleDateFormat.format(cal1.getTime())); 
    178                                 } else { 
    179                                         linkProperty = getLinkProperty(cal2.getTime(), cal1.getTime()); 
    180                                 } 
    181                                 filterList.add(linkProperty); 
    182                                 filterOptions --; 
    183                                 cal1.setTime(cal2.getTime()); 
    184                         }                        
    185                          
    186                 }else { 
    187                         while(daysInMonth >= dateRange && filterOptions > 1){ 
    188                         cal2.add(Calendar.DATE, -dateRange); 
    189                                 if(isBlogEntriesExistBetween(cal2.getTime(), cal1.getTime())){ 
    190                                         Calendar lastDate = Calendar.getInstance(); 
    191                                         lastDate.setTime(cal2.getTime()); 
    192                                         Calendar now = Calendar.getInstance(); 
    193                                         now.setTime(cal1.getTime()); 
    194                                         now.add(Calendar.DATE, -1); 
    195                                         if(lastDate.get(Calendar.DATE) - now.get(Calendar.DATE) <= dateRange && filterList.size() == 0){ 
    196                                                 linkProperty = new BlogArchives(); 
    197                                                 linkProperty.setLinkDisplayName("Last 7 days"); 
    198                                                 linkProperty.setLinkHrefValue(simpleDateFormat.format(cal2.getTime())+"/"+simpleDateFormat.format(cal1.getTime())); 
    199                                         } else { 
    200                                                 linkProperty = getLinkProperty(cal2.getTime(), cal1.getTime()); 
    201                                         } 
    202                                         filterList.add(linkProperty); 
    203                                         filterOptions --; 
    204                                         cal1.setTime(cal2.getTime()); 
    205                                 }                        
    206                                 daysInMonth -= dateRange;                        
    207                         } 
    208                 } 
    209  
    210                 SimpleDateFormat monthFormat = new SimpleDateFormat("MMMMM"); 
    211                 if(filterOptions > 0 && firstEntryDate.before(cal2.getTime())){ 
    212                         cal1.setTime(firstEntryDate); 
    213                         cal2.add(Calendar.MONTH, -1); 
    214                         cal2.set(Calendar.DAY_OF_MONTH, cal2.getActualMaximum(Calendar.DAY_OF_MONTH)); 
    215                         Calendar calTemp1 = Calendar.getInstance(); 
    216                         Calendar calTemp2 = Calendar.getInstance(); 
    217                         while(filterOptions > 0 && cal1.before(cal2)){                                                           
    218                                 calTemp1.setTime(cal2.getTime()); 
    219                                 calTemp2.setTime(cal2.getTime()); 
    220                                 calTemp1.set(Calendar.DAY_OF_MONTH, cal2.getActualMinimum(Calendar.DAY_OF_MONTH)); 
    221                                 //calTemp2.set(Calendar.DAY_OF_MONTH, cal2.getActualMaximum(Calendar.DAY_OF_MONTH)); 
    222                                 if(isBlogEntriesExistBetween(calTemp1.getTime(), calTemp2.getTime())){ 
    223                                         linkProperty = new BlogArchives(); //= getLinkProperty(calTemp1.getTime(), calTemp2.getTime()); 
    224                                         linkProperty.setLinkDisplayName(monthFormat.format(calTemp1.getTime())); 
    225                                         linkProperty.setLinkHrefValue(simpleDateFormat.format(calTemp1.getTime())+"/"+simpleDateFormat.format(calTemp2.getTime())); 
    226                                         filterList.add(linkProperty); 
    227                                         filterOptions --; 
    228                                 } 
    229                                 cal2.add(Calendar.MONTH, -1); 
    230                         } 
    231                         if(filterOptions == 0 && cal1.before(lastEntryDate)){ 
    232                                 if(isBlogEntriesExistBetween(cal1.getTime(), lastEntryDate)){ 
    233                                         linkProperty = new BlogArchives(); 
    234                                         linkProperty.setLinkDisplayName("<b>more</b>"); 
    235                                         linkProperty.setLinkHrefValue("more"); 
    236                                 } 
    237                         } 
    238                 } 
    239                 // if one or more filter options generated then only show the filter 
    240                 if(filterList != null && filterList.size() > 0){ 
    241                         setIsArchivesLinks(true); 
    242                 } 
    243                 return filterList; 
    244         } 
    245          
    246216        /** 
    247217         * Method for getting dropdown list values for archives filter 
     
    251221        public GenericSelectModel<BlogArchives> getArchivesModel() { 
    252222                return archiveBeans; 
    253         } 
    254  
    255         private void getArchivesLink(Date firstEntryDate, Date lastEntryDate, int dateInterval, int viewNLink) { 
    256                 archivesLink = new ArrayList<BlogArchives>(); 
    257                 BlogArchives linkProperty = null; 
    258                 if (firstEntryDate != null && lastEntryDate != null) { 
    259                         // setting year 
    260                         Calendar cal = Calendar.getInstance(); 
    261                         cal.setTime(firstEntryDate); 
    262                          
    263                         cal.set(Calendar.HOUR, 0); 
    264                         cal.set(Calendar.MINUTE, 0); 
    265                         cal.set(Calendar.SECOND, 0); 
    266                         cal.set(Calendar.MILLISECOND, 0); 
    267                         firstEntryDate = cal.getTime(); 
    268                          
    269                         int firstEntryYear = cal.get(Calendar.YEAR); 
    270                          
    271                         cal.setTime(lastEntryDate); 
    272                         cal.set(Calendar.HOUR, 0); 
    273                         cal.set(Calendar.MINUTE, 0); 
    274                         cal.set(Calendar.SECOND, 0); 
    275                         cal.set(Calendar.MILLISECOND, 0); 
    276                         lastEntryDate = cal.getTime(); 
    277                          
    278                         if (firstEntryYear == cal.get(Calendar.YEAR)) { 
    279                                 setArchivesYear("" + firstEntryYear); 
    280                         } else { 
    281                                 setArchivesYear("" + firstEntryYear + " - " + ("" + cal.get(Calendar.YEAR)).substring(2, 4)); 
    282                         }                        
    283                         cal.add(Calendar.DATE, -(dateInterval)); 
    284                         if(!firstEntryDate.equals(lastEntryDate)){                                                       
    285                                 lastEntryDate = cal.getTime(); 
    286                         } else { 
    287                                 firstEntryDate = cal.getTime(); 
    288                                 Calendar calTmp  = Calendar.getInstance(); 
    289                                 calTmp.setTime(lastEntryDate); 
    290                                 calTmp.add(Calendar.DATE, 1); 
    291                                 lastEntryDate = calTmp.getTime(); 
    292                         } 
    293                         if (!lastEntryDate.before(firstEntryDate) && !firstEntryDate.equals(lastEntryDate)) { 
    294                                 int nLink = 0; 
    295                                 while (firstEntryDate.before(lastEntryDate)) { 
    296                                         cal.setTime(firstEntryDate); 
    297                                         cal.add(Calendar.DATE, dateInterval); 
    298                                         if (nLink < viewNLink) { 
    299                                                 if (lastEntryDate.before(cal.getTime())) { 
    300                                                         if(isBlogEntriesExistBetween(firstEntryDate, lastEntryDate)) 
    301                                                                 linkProperty = getLinkProperty(firstEntryDate, lastEntryDate); 
    302                                                 } else { 
    303                                                         if(isBlogEntriesExistBetween(firstEntryDate, cal.getTime())) 
    304                                                                 linkProperty = getLinkProperty(firstEntryDate, cal.getTime()); 
    305                                                 } 
    306                                         } else { 
    307                                                 setIsMore(true); 
    308                                                 break; 
    309                                         } 
    310                                         firstEntryDate = cal.getTime(); 
    311                                         if(linkProperty != null){ 
    312                                                 archivesLink.add(linkProperty); 
    313                                                 nLink++; 
    314                                                 linkProperty = null; 
    315                                         } 
    316                                 } 
    317                         } 
    318                         // if one or more archives links generated then only show the archives 
    319                         if(archivesLink != null && archivesLink.size() > 0){ 
    320                                 setIsArchivesLinks(true); 
    321                         } 
    322                 } 
    323         } 
    324  
    325         private BlogArchives getLinkProperty(Date startDate, Date endDate) { 
    326                 blogArchive = new BlogArchives();        
    327  
    328                 Calendar calStart = Calendar.getInstance(); 
    329                 Calendar calEnd = Calendar.getInstance(); 
    330                 calStart.setTime(startDate); 
    331                 calEnd.setTime(endDate);                 
    332                 calEnd.set(Calendar.HOUR, 0); 
    333                 calEnd.set(Calendar.MINUTE, 0); 
    334                 calEnd.set(Calendar.SECOND, 0); 
    335                 calEnd.set(Calendar.MILLISECOND, 0); 
    336                  
    337                 /*if(calStart.getTime().compareTo(calEnd.getTime()) < 0) { 
    338                         calEnd.add(Calendar.DATE, -1); 
    339                 }*/ 
    340  
    341                 if (calStart.get(Calendar.MONTH) == calEnd.get(Calendar.MONTH)) { 
    342                         blogArchive.setLinkDisplayName(userDateFormat.formatDate(startDate, monthFormatPattern) + " " + calStart.get(Calendar.DATE) + " - " 
    343                                         + calEnd.get(Calendar.DATE)); 
    344                 } else { 
    345                         blogArchive.setLinkDisplayName(userDateFormat.formatDate(endDate, monthFormatPattern) + " " + calStart.get(Calendar.DATE) + " - " 
    346                                         + userDateFormat.formatDate(endDate, monthFormatPattern) + " " + calEnd.get(Calendar.DATE)); 
    347                 } 
    348  
    349                 //String dateFormatPattern = "dd-MM-yyyy"; 
    350                 SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy"); 
    351                 blogArchive.setLinkHrefValue(dateFormat.format(startDate) + "/" + dateFormat.format(endDate)); 
    352                 //blogArchive.setLinkHrefValue( SessionManager.getJSPRootURL() + "/blog/view/" 
    353                                 //userDateFormat.formatDate(startDate, dateFormatPattern) + "/" + userDateFormat.formatDate(endDate, dateFormatPattern)); // + "/" 
    354                                 //+ viewBlog.getUserId() + "?module=" + viewBlog.getModuleId()); 
    355  
    356                 return blogArchive; 
    357223        } 
    358224         
     
    542408                this.userWeblogEntries = userWeblogEntries; 
    543409        } 
    544  
    545410        /** 
    546411         * @return the moduleId 
    547412         */ 
     413 
     414        public List<BlogArchives> getArchivesListForDaysAndPost() { 
     415                return archivesListForDaysAndPost; 
     416        } 
     417 
     418        public void setArchivesListForDaysAndPost( 
     419                        List<BlogArchives> archivesListForDaysAndPost) { 
     420                this.archivesListForDaysAndPost = archivesListForDaysAndPost; 
     421        } 
     422 
     423        public String getCommaSeparator() { 
     424                return commaSeparator; 
     425        } 
     426 
     427        public void setCommaSeparator(String commaSeparator) { 
     428                this.commaSeparator = commaSeparator; 
     429        } 
    548430} 
  • trunk/core/src/net/project/view/pages/assignments/MyAssignments.java

    r18170 r18180  
    399399                                blogEntries.setJspRootURL(JSPRootURL); 
    400400                                blogEntries.setUserWeblogEntries(blogViewProvider.getFormattedBlogEntries(entries, JSPRootURL, SpaceTypes.PERSONAL_SPACE)); 
    401                                 blogEntries.setLinkToPersonSpace(true); 
     401                                blogEntries.setLinkToPersonSpace(false); 
    402402                                blogEntries.setShowEditLink(false); 
    403403                                blogEntries.setShowExpandCollapseImage(false); 
  • trunk/core/src/net/project/view/pages/blog/AddWebLogEntry.java

    r18170 r18180  
    325325                                                if (pnWeblogEntry == null) { 
    326326                                                        saveBlogEntry(); 
    327                                                         return new TextStreamResponse("text", "Entry Saved"); 
     327                                                        return new TextStreamResponse("text", "true"); 
    328328                                                        //return getSavedBlogEntries(); 
    329329                                                } else { 
  • trunk/core/src/net/project/view/pages/blog/ViewBlog.java

    r18170 r18180  
    344344                                String startDateString = request.getParameter("startDate"); 
    345345                                String endDateString = request.getParameter("endDate"); 
     346                                int post = request.getParameter("posts") == null ? 0 : Integer.parseInt(request.getParameter("posts")); 
    346347                                Date startDate = null; 
    347348                                Date endDate = null; 
    348349                                try { 
    349                                         startDate = userDateFormat.parseDateString(startDateString, "dd-MM-yyyy"); 
    350                                         endDate = userDateFormat.parseDateString(endDateString, "dd-MM-yyyy"); 
     350                                        if(StringUtils.isNotEmpty(startDateString) && StringUtils.isNotEmpty(endDateString)){ 
     351                                                startDate = userDateFormat.parseDateString(startDateString, "dd/MM/yyyy"); 
     352                                                endDate = userDateFormat.parseDateString(endDateString, "dd/MM/yyyy"); 
     353                                        } 
    351354                                        setUserWeblogEntries(blogProvider.getFilteredWeblogEntries(userWeblog.getWeblogId(),  
    352355                                                        StringUtils.isNotEmpty(memberId) ? new Integer(memberId) : null, 
    353356                                                        StringUtils.isNotEmpty(objectId) ? new Integer(objectId) : null,  
    354                                                         startDate, endDate, WeblogConstants.STATUS_PUBLISHED, 0, 0, null)); 
     357                                                        startDate, endDate, WeblogConstants.STATUS_PUBLISHED, 0, post, null)); 
    355358                                        if (spaceType.equals(Space.PERSONAL_SPACE)) { 
    356359                                                // get blog entries from project weblogs 
     
    358361                                                        userWeblogEntries.addAll(blogProvider.getWeblogEntriesFromProjectBlogByPerson(userId, 
    359362                                                                        StringUtils.isNotEmpty(objectId) ? new Integer(objectId) : null, startDate, 
    360                                                                         endDate, WeblogConstants.STATUS_PUBLISHED, 0, 0)); 
     363                                                                        endDate, WeblogConstants.STATUS_PUBLISHED, 0, post)); 
    361364                                                } else { 
    362365                                                        userWeblogEntries = blogProvider.getWeblogEntriesFromProjectBlogByPerson(userId, 
    363366                                                                        StringUtils.isNotEmpty(objectId) ? new Integer(objectId) : null, startDate, 
    364                                                                         endDate, WeblogConstants.STATUS_PUBLISHED, 0, 0); 
     367                                                                        endDate, WeblogConstants.STATUS_PUBLISHED, 0, post); 
    365368                                                } 
    366369                                        } 
     
    380383                                        setMessage("Blog entries not found"); 
    381384                                } else { 
     385                                        setUserWeblogEntries(blogProvider.getSortedBlogEntries(userWeblogEntries)); 
     386                                        if(post > 0 && getUserWeblogEntries().size() >= post) 
     387                                                setUserWeblogEntries(userWeblogEntries.subList(0, post)); 
    382388                                        setMessage(getUserWeblogEntries().size() == 1 ? "1 blog entry found" : getUserWeblogEntries().size()+" blog entries found"); 
    383                                         setUserWeblogEntries(blogProvider.getSortedBlogEntries(userWeblogEntries)); 
    384389                                } 
    385390                                 
     
    410415                                        } 
    411416                                } 
    412                         }else if(action.equalsIgnoreCase(BlogAction.LOAD_BLOG_ENTRIES.toString())){ 
    413                                 blogEntriesLoadedForObject = request.getParameter("blogEntriesLoadedForObject") == null ? false 
    414                                                 : Boolean.parseBoolean(request.getParameter("blogEntriesLoadedForObject"));  
    415                                 return loadBlogEntries(); 
    416417                        } 
    417418                } 
    418419                return null; 
    419         } 
    420          
    421         /** 
    422          * To load blog entries after page load 
    423          * @return list of blog entries 
    424          */ 
    425         Object loadBlogEntries() { 
    426                 if (!isBlogEntriesLoadedForObject()) { 
    427                         getBlogEntries(userDateFormat.formatDate(previousDate, startEndDateFormatPattern), userDateFormat 
    428                                         .formatDate(currentDate, startEndDateFormatPattern), userId.toString()); 
    429                 } else if (userWeblogEntries != null) { 
    430                         setUserWeblogEntries(blogProvider.getSortedBlogEntries(userWeblogEntries)); 
    431                         setBlogEntriesLoadedForObject(false); 
    432                 } 
    433                 blogEntries.setMessage(getMessage()); 
    434                 blogEntries.setUserWeblogEntries(blogViewProvider.getFormattedBlogEntries(userWeblogEntries, getJspRootURL(), 
    435                                 getSpaceType())); 
    436                 blogEntries.setLinkToPersonSpace(getLinkToPersonSpace()); 
    437                 blogEntries.setShowEditLink(true); 
    438                 blogEntries.setShowExpandCollapseImage(true); 
    439                 blogEntries.setShowPersonImage(true); 
    440                 blogEntries.setBlogCommentDivClass("comment-entry"); 
    441                 blogEntries.setBlogPostDivClass("post-body"); 
    442                 return blogEntries; 
    443420        } 
    444421         
  • trunk/core/web/css/blog.css

    r18164 r18180  
    417417} 
    418418#loadBlogEntries { 
    419         margin-left: 42px; 
     419        /*margin-left: 42px;*/ 
    420420} 
    421421#uploadScreen { 
     
    454454        margin-top: 0px; 
    455455} 
     456#showDaysAndPostsDiv { 
     457        color: #000000; 
     458        font-family: Arial, Helvetica, sans-serif; 
     459        font-size: 12px; 
     460} 
     461#showDaysAndPostsDiv a { 
     462        color: #4259cb; 
     463} 
     464.fieldSetCls {  
     465        border: 0px solid #B5B8C8; 
     466        padding-bottom: 5px; 
     467} 
     468.x-date-middle { 
     469    padding-top: 2px;  
     470    padding-bottom: 2px; 
     471    width: 130px; /* FF3 */ 
     472} 
     473 
  • trunk/core/web/html/blog/ViewBlog.html

    r18170 r18180  
    134134                                                        <td>                                                             
    135135                                                                <div id="loadBlogEntries"> 
    136                                                                          <font color="blue" style="font-weight: bold; size: 12px;" >Loading Blog Entries...</font> 
     136                                                                         <font color="blue" style="font-weight: bold; size: 12px;padding-left:42px" >Loading Blog Entries...</font> 
    137137                                                                         <img src="${jspRootURL}/images/default/grid/loading.gif" align="absmiddle" /> 
    138138                                                                </div> 
     
    164164var blogEntriesLoadedForObject = '${BlogEntriesLoadedForObject}'; 
    165165var openBlogEntries = blogEntryIds.split(',').length-1; 
    166  
     166var startDate, endDate,posts; 
    167167// initializing content panel with html editor 
     168 
     169<!-- // 
    168170function initializeContentPanel(){ 
    169171    Ext.QuickTips.init(); 
     
    184186 
    185187initializeContentPanel(); 
    186  
    187 var datesCombo = new Ext.form.ComboBox({ 
    188                            fieldLabel: 'Dates', 
    189                typeAhead: true, 
    190                triggerAction: 'all', 
    191                transform: 'archives', 
    192                lazyRender: true, 
    193                listClass: 'x-combo-list-small', 
    194                editable: false, 
    195                            width: 120, 
    196                            listWidth : 120 
    197         }); 
    198          
    199 var projectsCombo = null;         
    200 var viewCombo = null; 
    201 var teamCombo = null; 
    202 var taskCombo = null; 
    203 var filterForm; 
    204  
    205 if(spaceType == 'project'){ 
    206         viewCombo = new Ext.form.ComboBox({ 
    207                            fieldLabel: 'View', 
    208                typeAhead: true, 
    209                triggerAction: 'all', 
    210                transform: 'assignmentFilter', 
    211                lazyRender: true, 
    212                listClass: 'x-combo-list-small', 
    213                editable : false, 
    214                            width: 100, 
    215                            listWidth : 100 
    216     }); 
    217         teamCombo = new Ext.form.ComboBox({ 
    218                fieldLabel: 'Team', 
    219                typeAhead: true, 
    220                triggerAction: 'all', 
    221                transform: 'team', 
    222                lazyRender: true, 
    223                listClass: 'x-combo-list-small', 
    224                editable : false, 
    225                            width: 130, 
    226                            listWidth : 130 
    227     }); 
    228         taskCombo = new Ext.form.ComboBox({ 
    229                            fieldLabel: 'Task', 
    230                typeAhead: true, 
    231                triggerAction: 'all', 
    232                transform: 'task', 
    233                lazyRender: true, 
    234                listClass: 'x-combo-list-small', 
    235                editable : false, 
    236                            width: 180, 
    237                            listWidth : 180 
    238     }); 
    239 } else { 
    240         projectsCombo = new Ext.form.ComboBox({ 
    241                                  fieldLabel: 'Projects:', 
    242                                  labelAlign     : 'left', 
    243                          typeAhead: true, 
    244                          triggerAction: 'all', 
    245                          transform: 'projectFilter', 
    246                          lazyRender: true, 
    247                          listClass: 'x-combo-list-small', 
    248                          editable: false, 
    249                                  width: 160, 
    250                                  listWidth : 160 
    251          }); 
    252 } 
    253  
    254 Ext.onReady(function(){ 
    255  
    256     Ext.QuickTips.init(); 
    257      
    258     var personFilters = [{ 
    259                     layout: 'column', 
    260                     items:[{ 
    261                                         columnWidth:.4, 
    262                                         layout: 'form', 
    263                                         items: [ 
    264                                                         datesCombo 
    265                                                 ] 
    266                                     },{ 
    267                                         columnWidth:.6, 
    268                                         layout: 'form', 
    269                                         items: [ 
    270                                                         projectsCombo 
    271                                                 ] 
    272                                     }] 
    273                 }]; 
    274          
    275         var projectFilters = [{ 
    276                     layout: 'column', 
    277                     items:[{ 
    278                                         columnWidth:.3, 
    279                                         layout: 'form', 
    280                                         items: [ 
    281                                                 viewCombo 
    282                                                 ] 
    283                                     },{ 
    284                                         columnWidth:.4, 
    285                                         layout: 'form', 
    286                                         items: [         
    287                                                         datesCombo 
    288                                                 ] 
    289                                     },{ 
    290                                         columnWidth:.3, 
    291                                         layout: 'form', 
    292                                         items: [         
    293                                                                 teamCombo 
    294                                                 ] 
    295                                     }] 
    296                 }, taskCombo 
    297                 ]; 
    298  
    299                 filterForm = new Ext.FormPanel({ 
    300         labelWidth: 60, 
    301         frame: true, 
    302                 collapsible: true, 
    303                 collapsed: true, 
    304         title: 'Filters', 
    305         bodyStyle: 'padding:1px 1px 0', 
    306         width: '650px', 
    307         monitorResize : true, 
    308         items: spaceType == 'person' ? personFilte