roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r375289 - in /incubator/roller/trunk: metadata/xdoclet/ sandbox/atomprotocol/src/org/roller/presentation/atomapi/ src/org/roller/business/ src/org/roller/business/hibernate/ src/org/roller/business/search/operations/ src/org/roller/model/ s...
Date Mon, 06 Feb 2006 14:46:54 GMT
Author: snoopdave
Date: Mon Feb  6 06:46:53 2006
New Revision: 375289

URL: http://svn.apache.org/viewcvs?rev=375289&view=rev
Log:
Made entry queries sortable by updateTime or pubTime (ROL-1009), make entries page pagable (ROL-1036), fixed comment sorting in getRecentComments() (ROL-1035)

Added:
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryManagementAction.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryManagementForm.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryQueryForm.java
    incubator/roller/trunk/web/weblog/WeblogEntryManagement.jsp
    incubator/roller/trunk/web/weblog/WeblogEntryManagementSidebar.jsp
Removed:
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogQueryAction.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogQueryForm.java
    incubator/roller/trunk/web/weblog/WeblogQuery.jsp
    incubator/roller/trunk/web/weblog/WeblogQuerySidebar.jsp
Modified:
    incubator/roller/trunk/metadata/xdoclet/global-forwards.xml
    incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
    incubator/roller/trunk/src/org/roller/business/WeblogManagerImpl.java
    incubator/roller/trunk/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java
    incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java
    incubator/roller/trunk/src/org/roller/business/search/operations/RebuildWebsiteIndexOperation.java
    incubator/roller/trunk/src/org/roller/model/WeblogManager.java
    incubator/roller/trunk/src/org/roller/presentation/MainPageAction.java
    incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java
    incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties
    incubator/roller/trunk/web/WEB-INF/editor-menu.xml
    incubator/roller/trunk/web/WEB-INF/tiles-defs.xml
    incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp
    incubator/roller/trunk/web/website/UploadFile.jsp
    incubator/roller/trunk/web/website/UserAdmin.jsp
    incubator/roller/trunk/web/website/YourWebsites.jsp

Modified: incubator/roller/trunk/metadata/xdoclet/global-forwards.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/xdoclet/global-forwards.xml?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/xdoclet/global-forwards.xml (original)
+++ incubator/roller/trunk/metadata/xdoclet/global-forwards.xml Mon Feb  6 06:46:53 2006
@@ -22,7 +22,7 @@
 
 <forward name="weblogEdit"             path="/editor/weblog.do?method=edit"/>
 <forward name="weblogCreate"           path="/editor/weblog.do?method=create"/>
-<forward name="weblogQuery"            path="/editor/weblogQuery.do?method=query"/>
+<forward name="weblogEntryManagement"  path="/editor/weblogEntryManagement.do?method=query"/>
 <forward name="commentManagement"      path="/editor/commentManagement.do?method=query"/>
 <forward name="commentQuery"           path="/editor/commentQuery.do?method=query"/>
 <forward name="categories"             path="/editor/categories.do?method=selectCategory"/>

Modified: incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java (original)
+++ incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java Mon Feb  6 06:46:53 2006
@@ -203,12 +203,13 @@
         List entries = null;
         if (canView(website)) {
             entries = mRoller.getWeblogManager().getWeblogEntries(
-                    website,  // website
-                    null,   // startDate
-                    null,   // endDate
-                    null,   // catName
-                    null,   // status
-                    start, // offset (for range paging)
+                    website,           // website
+                    null,              // startDate
+                    null,              // endDate
+                    null,              // catName
+                    null,              // status
+                    "updateTime",      // sortby
+                    start,             // offset (for range paging)
                     end - start + 2);  // maxEntries
             Feed feed = new Feed();
             List atomEntries = new ArrayList();

Modified: incubator/roller/trunk/src/org/roller/business/WeblogManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/WeblogManagerImpl.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/WeblogManagerImpl.java (original)
+++ incubator/roller/trunk/src/org/roller/business/WeblogManagerImpl.java Mon Feb  6 06:46:53 2006
@@ -43,27 +43,9 @@
     
     /* inline creation of reverse comparator, anonymous inner class */
     private Comparator reverseComparator = new ReverseComparator();
-    /*
-    new Comparator()
-    {
-        public int compare(Object o1, Object o2)
-        {
-            return -1 * ((Date) o1).compareTo((Date)o2);
-        }
-    };
-    */
     
     private SimpleDateFormat formatter = DateUtil.get8charDateFormat();
 
-    public abstract List getWeblogEntries(
-                    WebsiteData website, 
-                    Date    startDate, 
-                    Date    endDate, 
-                    String  catName, 
-                    String  status, 
-                    Integer maxEntries,
-                    Boolean pinned) throws RollerException;
-
     public abstract List getNextPrevEntries(
                     WeblogEntryData current, 
                     String catName, 
@@ -81,19 +63,11 @@
 
     //------------------------------------------------ WeblogCategoryData CRUD
 
-    /**
-     * @see org.roller.model.WeblogManager#createWeblogCategory()
-     */
     public WeblogCategoryData createWeblogCategory()
     {
         return new WeblogCategoryData();
     }
 
-    /**
-     * @see org.roller.model.WeblogManager#createWeblogCategory(
-     * org.roller.pojos.WebsiteData, org.roller.pojos.WeblogCategoryData,
-     * java.lang.String, java.lang.String, java.lang.String)
-     */
     public WeblogCategoryData createWeblogCategory(
         WebsiteData website,
         WeblogCategoryData parent,
@@ -261,83 +235,27 @@
 		removeCommentsForEntry( id );
         mStrategy.remove(id, WeblogEntryData.class);
     }
-
-    //------------------------------------------------ WeblogEntryData Queries
-
-    /**
-     * Gets the Date of the latest Entry publish time, before the end of today,
-     * for all WeblogEntries
-     *
-     * @param userName
-     * @return Date
-     * @throws RollerException
-     */
-    public Date getWeblogLastPublishTime(WebsiteData website)
-        throws RollerException
-    {
-        return getWeblogLastPublishTime(website, null);
-    }
-
-    //--------------------------------------------------------- Implementation
-
-    /** 
-     * Get weblog entries.
-     * @see org.roller.model.WeblogManager#getWeblogEntries(
-     *   java.lang.String, 
-     *   java.util.Date, 
-     *   java.util.Date, 
-     *   java.lang.String, 
-     *   java.lang.String, 
-     *   java.lang.Integer)
-     */
-    public List getWeblogEntries(
-                    WebsiteData website, 
-                    Date    startDate, 
-                    Date    endDate, 
-                    String  catName, 
-                    String  status, 
-                    Integer maxEntries) throws RollerException
-    {
-        return getWeblogEntries(
-                    website, 
-                    startDate, 
-                    endDate, 
-                    catName, 
-                    status, 
-                    maxEntries, 
-                    null);
-    }
-
-    /** 
-     * Get webloog entries in range specified by offset and length.
-     * @see org.roller.model.WeblogManager#getWeblogEntries(
-     *   java.lang.String, 
-     *   java.util.Date, 
-     *   java.util.Date, 
-     *   java.lang.String, 
-     *   java.lang.String, 
-     *   int offset,
-     *   int length)
-     */
+    
     public List getWeblogEntries(
-                    WebsiteData website, 
-                    Date    startDate, 
-                    Date    endDate, 
-                    String  catName, 
-                    String  status, 
-                    int offset,
-                    int range) throws RollerException
+                    WebsiteData website,
+                    Date    startDate,
+                    Date    endDate,
+                    String  catName,
+                    String  status,
+                    String  sortby,
+                    int     offset,
+                    int     range) throws RollerException
     {
         List filtered = new ArrayList();
         List entries = getWeblogEntries(
-                    website, 
-                    startDate, 
-                    endDate, 
-                    catName, 
-                    status, 
-                    new Integer(offset + range), 
-                    null);
-        if (entries.size() < offset) 
+                    website,
+                    startDate,
+                    endDate,
+                    catName,
+                    status,
+                    sortby,
+                    new Integer(offset + range));
+        if (entries.size() < offset)
         {
             return entries;
         }
@@ -348,15 +266,16 @@
         return filtered;
     }
 
-    /** 
-     * @see org.roller.model.WeblogManager#getWeblogEntryDayMap(
-     * java.lang.String, 
-     * java.util.Date, 
-     * java.util.Date, 
-     * java.lang.String, 
-     * java.lang.String, 
-     * java.lang.Integer)
+    /**
+     * Gets the Date of the latest Entry publish time, before the end of today,
+     * for all WeblogEntries
      */
+    public Date getWeblogLastPublishTime(WebsiteData website)
+        throws RollerException
+    {
+        return getWeblogLastPublishTime(website, null);
+    }
+
     public Map getWeblogEntryObjectMap(
                     WebsiteData website, 
                     Date    startDate, 
@@ -375,15 +294,6 @@
                         false);
     }
     
-    /** 
-     * @see org.roller.model.WeblogManager#getWeblogEntryDayMap(
-     * java.lang.String, 
-     * java.util.Date, 
-     * java.util.Date, 
-     * java.lang.String, 
-     * java.lang.String, 
-     * java.lang.Integer)
-     */
     public Map getWeblogEntryStringMap(
                     WebsiteData website, 
                     Date    startDate, 
@@ -419,6 +329,7 @@
                         endDate,
                         catName,
                         status,
+                        null,
                         maxEntries);
         
         Calendar cal = Calendar.getInstance();
@@ -450,9 +361,6 @@
         return map;
     }
     
-    /* 
-     * @see org.roller.model.WeblogManager#getNextEntry(org.roller.pojos.WeblogEntryData)
-     */
     public List getNextEntries(
             WeblogEntryData current, String catName, int maxEntries)
         throws RollerException
@@ -460,9 +368,6 @@
         return getNextPrevEntries(current, catName, maxEntries, true);
     }
 
-    /* 
-     * @see org.roller.model.WeblogManager#getPreviousEntry(org.roller.pojos.WeblogEntryData)
-     */
     public List getPreviousEntries(
             WeblogEntryData current, String catName, int maxEntries)
         throws RollerException
@@ -494,15 +399,6 @@
         return entry;
     }
     
-    /** 
-     * @see org.roller.model.WeblogManager#getWeblogEntriesPinnedToMain(int)
-     */
-    public List getWeblogEntriesPinnedToMain(Integer max) throws RollerException
-    {
-        return getWeblogEntries(
-            null, null, new Date(), null, null, max, Boolean.TRUE);
-    }
-
     /**
      * Get absolute URL to this website.
      * @return Absolute URL to this website.

Modified: incubator/roller/trunk/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java (original)
+++ incubator/roller/trunk/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java Mon Feb  6 06:46:53 2006
@@ -354,6 +354,7 @@
                         new Date(),                  // endDate
                         null,                        // catName
                         WeblogEntryData.PUBLISHED,   // status
+                        null,                        // sortby (null means pubTime)
                         new Integer(entryCount));    // maxEntries
                     
                     sub.setLastUpdated(siteUpdated);

Modified: incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java (original)
+++ incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java Mon Feb  6 06:46:53 2006
@@ -183,8 +183,8 @@
                     Date    endDate, 
                     String  catName, 
                     String  status, 
-                    Integer maxEntries,
-                    Boolean pinned) throws RollerException
+                    String  sortby,
+                    Integer maxEntries) throws RollerException
     {
         WeblogCategoryData cat = null;        
         if (StringUtils.isNotEmpty(catName) && website != null)
@@ -233,17 +233,40 @@
             {
                 criteria.add(Expression.eq("status", status));
             }        
-
-            if (pinned != null)
+                    
+            if (sortby != null && sortby.equals("updateTime"))
             {
-                criteria.add(Expression.eq("pinnedToMain", pinned));
+                criteria.addOrder(Order.desc("updateTime"));
+            }
+            else
+            {
+                criteria.addOrder(Order.desc("pubTime"));
             }
-                            
-            criteria.addOrder(Order.desc("pubTime"));
             
             if (maxEntries != null) 
             {
                 criteria.setMaxResults(maxEntries.intValue());
+            }            
+            return criteria.list();                                             
+        }
+        catch (HibernateException e)
+        {
+            mLogger.error(e);
+            throw new RollerException(e);
+        }
+    }
+    
+    public List getWeblogEntriesPinnedToMain(Integer max) throws RollerException 
+    {
+        try
+        {
+            Session session = ((HibernateStrategy)mStrategy).getSession();
+            Criteria criteria = session.createCriteria(WeblogEntryData.class);
+            criteria.add(Expression.eq("pinnedToMain", Boolean.TRUE));                            
+            criteria.addOrder(Order.desc("pubTime"));            
+            if (max != null) 
+            {
+                criteria.setMaxResults(max.intValue());
             }            
             return criteria.list();
         }

Modified: incubator/roller/trunk/src/org/roller/business/search/operations/RebuildWebsiteIndexOperation.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/search/operations/RebuildWebsiteIndexOperation.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/search/operations/RebuildWebsiteIndexOperation.java (original)
+++ incubator/roller/trunk/src/org/roller/business/search/operations/RebuildWebsiteIndexOperation.java Mon Feb  6 06:46:53 2006
@@ -110,12 +110,13 @@
                 WeblogManager weblogManager = roller.getWeblogManager();
 
                 List entries = weblogManager .getWeblogEntries(
-                    website,                 // userName
-                    null,                   // startDate
-                    new Date(),             // endDate // don't index 'future' entries
-                    null,                   // catName
+                    website,                   // userName
+                    null,                      // startDate
+                    new Date(),                // endDate (don't index 'future' entries)
+                    null,                      // catName
                     WeblogEntryData.PUBLISHED, // status
-                    null);    
+                    null,                      // sortby (null mean pubTime)
+                    null);                     // maxEntries (null to get 'em all)
 
                 for (Iterator wbItr = entries.iterator(); wbItr.hasNext();) 
                 {

Modified: incubator/roller/trunk/src/org/roller/model/WeblogManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/model/WeblogManager.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/model/WeblogManager.java (original)
+++ incubator/roller/trunk/src/org/roller/model/WeblogManager.java Mon Feb  6 06:46:53 2006
@@ -186,15 +186,18 @@
         throws RollerException;
 
     //------------------------------------------------ WeblogEntryData Queries
-
+    
     /**
-     * Get WeblogEntries as a list in reverse chronological order.
+     * Get WeblogEntries by offset/length as list in reverse chronological order.
+     * The range offset and list arguments enable paging through query results.
      * @param userName   User name or null to get for all users.
      * @param startDate  Start date or null for no start date.
      * @param endDate    End date or null for no end date.
      * @param catName    Category path or null for all categories.
-     * @param status     Status of ALL, DRAFT_ONLY, or PUB_ONLY.
-     * @param maxEntries Max entries or null for no limit.
+     * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
+     * @param sortby     Sort by either 'pubTime' or 'updateTime' (null for pubTime)
+     * @param offset     Index of first entry to include.
+     * @param length     Max number of entries to include.
      * @return List of WeblogEntryData objects in reverse chrono order.
      * @throws RollerException
      */
@@ -204,19 +207,21 @@
                     Date    endDate, 
                     String  catName, 
                     String  status,
-                    Integer maxEntries)
+                    String  sortBy,
+                    int offset,
+                    int range)  
                     throws RollerException;
-    
     /**
-     * Get WeblogEntries in range as list in reverse chronological order.
+     * Get WeblogEntries up to limit as list in reverse chronological order.
      * The range offset and list arguments enable paging through query results.
      * @param userName   User name or null to get for all users.
      * @param startDate  Start date or null for no start date.
      * @param endDate    End date or null for no end date.
      * @param catName    Category path or null for all categories.
      * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
+     * @param sortby     Sort by either 'pubTime' or 'updateTime' (null for pubTime)
      * @param offset     Index of first entry to include.
-     * @param length     Max number of entries to include.
+     * @param maxEntries     Max number of entries to include.
      * @return List of WeblogEntryData objects in reverse chrono order.
      * @throws RollerException
      */
@@ -226,8 +231,8 @@
                     Date    endDate, 
                     String  catName, 
                     String  status,
-                    int     offset,
-                    int     length)
+                    String  sortBy,
+                    Integer maxEntries)  
                     throws RollerException;
     
     /**

Modified: incubator/roller/trunk/src/org/roller/presentation/MainPageAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/MainPageAction.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/MainPageAction.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/MainPageAction.java Mon Feb  6 06:46:53 2006
@@ -104,7 +104,8 @@
                         new Date(),             // endDate
                         null,                   // catName
                         WeblogEntryData.PUBLISHED, // status
-                        new Integer(num));       // maxEntries
+                        null,                   // sortby (null for pubTime)
+                        new Integer(num));      // maxEntries
             } catch (Exception e) {
                 mLogger.error(e);
             }

Modified: incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java Mon Feb  6 06:46:53 2006
@@ -424,11 +424,12 @@
             
             List mEntries = mgr.getWeblogEntries(
                     mRollerReq.getWebsite(),
-                    null,                    // startDate
-                    day,                      // endDate
-                    catParam,                 // catName
+                    null,                        // startDate
+                    day,                         // endDate
+                    catParam,                    // catName
                     WeblogEntryData.PUBLISHED,   // status
-                    new Integer(maxEntries)); // maxEntries
+                    null,                        // sortby (null for pubTime)
+                    new Integer(maxEntries));    // maxEntries
             
             // wrap pojos
             ret = new ArrayList(mEntries.size());
@@ -757,7 +758,7 @@
                     null,  // pending
                     Boolean.TRUE,  // approved only
                     Boolean.FALSE, // no spam
-                    false,         // we want chrono order
+                    true,          // we want reverse chrono order
                     0,             // offset
                     maxCount);     // no limit
             

Modified: incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java Mon Feb  6 06:46:53 2006
@@ -38,7 +38,7 @@
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
 import org.roller.presentation.velocity.ExportRss;
-import org.roller.presentation.weblog.formbeans.WeblogQueryForm;
+import org.roller.presentation.weblog.formbeans.WeblogEntryManagementForm;
 import org.roller.util.DateUtil;
 
 /**
@@ -131,7 +131,7 @@
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
             RollerSession rses = RollerSession.getRollerSession(rreq.getRequest());
-            WeblogQueryForm form = (WeblogQueryForm)actionForm;
+            WeblogEntryManagementForm form = (WeblogEntryManagementForm)actionForm;
             if ( rreq.getWebsite() != null 
                     && rses.isUserAuthorizedToAdmin(rreq.getWebsite()) )
             {               
@@ -167,8 +167,9 @@
                                     startDate,         // startDate
                                     endDate,           // endDate
                                     null,              // catName
-                                    null,  // status
-                                    null);              // maxEntries
+                                    null,              // status
+                                    null,              // sortby (null for pubtime)
+                                    null);             // maxEntries
 
                     ActionMessages messages = writeSuccessMessage(request, response, rreq, form);
 
@@ -272,7 +273,7 @@
                     HttpServletRequest request, 
                     HttpServletResponse response, 
                     RollerRequest rreq, 
-                    WeblogQueryForm form) throws MalformedURLException
+                    WeblogEntryManagementForm form) throws MalformedURLException
     {
         PageContext pageContext =
             JspFactory.getDefaultFactory().getPageContext( 

Added: incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryManagementAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryManagementAction.java?rev=375289&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryManagementAction.java (added)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryManagementAction.java Mon Feb  6 06:46:53 2006
@@ -0,0 +1,223 @@
+
+package org.roller.presentation.weblog.actions;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.actions.DispatchAction;
+import org.roller.RollerException;
+import org.roller.model.RollerFactory;
+import org.roller.model.WeblogManager;
+import org.roller.pojos.WeblogCategoryData;
+import org.roller.pojos.WeblogEntryData;
+import org.roller.pojos.WebsiteData;
+import org.roller.presentation.BasePageModel;
+import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
+import org.roller.presentation.weblog.formbeans.WeblogEntryManagementForm;
+import org.roller.util.DateUtil;
+
+
+/////////////////////////////////////////////////////////////////////////////
+/**
+ * Query weblog entries and display the results in tabular form.
+ *
+ * @struts.action path="/editor/weblogEntryManagement" name="weblogEntryManagementForm" 
+ *     scope="request" parameter="method"
+ * 
+ * @struts.action-forward name="weblogEntryManagement.page" path=".WeblogEntryManagement"
+ * 
+ * @author Dave Johnson
+ */
+public final class WeblogEntryManagementAction extends DispatchAction
+{
+    //-----------------------------------------------------------------------
+    /**
+     * Respond to request to add a new or edit an existing weblog entry.
+     * Loads the appropriate model objects and forwards the request to
+     * the edit weblog page.
+     */
+    public ActionForward query(
+        ActionMapping       mapping,
+        ActionForm          actionForm,
+        HttpServletRequest  request,
+        HttpServletResponse response)
+        throws IOException, ServletException, RollerException
+    {
+        WeblogEntryManagementForm form = (WeblogEntryManagementForm)actionForm;
+        RollerRequest   rreq = RollerRequest.getRollerRequest(request);
+        WeblogManager   wmgr = RollerFactory.getRoller().getWeblogManager();           
+        RollerSession   rses = RollerSession.getRollerSession(request);
+        
+        // ensure that weblog is specfied and user has permission to work there
+        if (rreq.getWebsite() != null && rses.isUserAuthorized(rreq.getWebsite())) {
+            String status= form.getStatus().equals("ALL") ? null : form.getStatus();        
+            request.setAttribute("model", new PageModel(
+               request, 
+               response, 
+               mapping,
+               rreq.getWebsite(),
+               form)); 
+        } 
+        else 
+        {
+            return mapping.findForward("access-denied");
+        }
+        return mapping.findForward("weblogEntryManagement.page");
+    }
+    
+    public class PageModel extends BasePageModel {
+        private List               entries = null;
+        private RollerRequest      rollerRequest = null;
+        private HttpServletRequest request = null;
+        private WebsiteData        website = null;
+        private String             category = null;
+        private Date               startDate = null;
+        private Date               endDate = null;
+        private String             status = WeblogEntryData.PUBLISHED;
+        private Integer            maxEntries = null;
+        private boolean            more = false;
+        private WeblogEntryManagementForm    queryForm = null;
+
+        public PageModel( 
+                HttpServletRequest request,
+                HttpServletResponse response,
+                ActionMapping mapping,
+                WebsiteData website,
+                WeblogEntryManagementForm queryForm) throws RollerException {
+            super("weblogEntryQuery.title", request, response, mapping);
+            rollerRequest = RollerRequest.getRollerRequest(request);
+            this.request = request;
+            this.queryForm = queryForm;
+            this.website = website;
+
+            if (null != queryForm.getCategoryId() && !queryForm.getCategoryId().equals("")) {
+                WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+                WeblogCategoryData cd = wmgr.retrieveWeblogCategory(queryForm.getCategoryId());
+                category = cd.getPath();
+            }
+
+            final DateFormat df =
+                    DateFormat.getDateInstance(DateFormat.SHORT, request.getLocale());
+            String start = queryForm.getStartDateString();
+            if (null != start && start.trim().length() > 0) {
+                try {
+                    startDate = DateUtil.getStartOfDay(df.parse(start));
+                } catch (ParseException e) {
+                    throw new RollerException("ERROR parsing start date.");
+                }
+            }
+
+            String end = queryForm.getEndDateString();
+            if (null != end && end.trim().length() > 0) {
+                try {
+                    endDate = DateUtil.getEndOfDay(df.parse(end));
+                } catch (ParseException e) {
+                    throw new RollerException("ERROR parsing end date.");
+                }
+            }
+
+            this.status = status;
+            this.maxEntries = maxEntries;
+
+            entries = RollerFactory.getRoller().getWeblogManager().getWeblogEntries(
+                    website,
+                    startDate,
+                    endDate,
+                    category,
+                    status,
+                    queryForm.getSortby(),
+                    queryForm.getOffset(),
+                    queryForm.getCount() + 1);
+           if (entries.size() > queryForm.getCount()) {
+               more = true;
+               entries.remove(entries.size()-1);
+           }
+        }
+
+        public String getBaseURL() {
+            return getRequest().getContextPath();
+        }
+
+        /**
+         * Get recent weblog entries using request parameters to determine
+         * username, date, and category name parameters.
+         * @return List of WeblogEntryData objects.
+         * @throws RollerException
+         */
+        public List getRecentWeblogEntries() throws RollerException {
+            return entries;
+        }
+
+        public int getWeblogEntryCount() {
+            return entries.size();
+        }
+        
+        public List getCategories() throws Exception {
+            RollerRequest rreq = RollerRequest.getRollerRequest(request);
+            List categories = RollerFactory.getRoller().getWeblogManager()
+            .getWeblogCategories(rreq.getWebsite());
+            return categories;
+        }
+
+        public Date getEarliestDate() {
+            Date date = null;
+            if (entries.size() > 0) {
+                WeblogEntryData earliest = (WeblogEntryData)entries.get(entries.size()-1);
+                date = earliest.getPubTime();
+            }
+            return date;
+        }
+
+        public Date getLatestDate() {
+            Date date = null;
+            if (entries.size() > 0) {
+                WeblogEntryData latest = (WeblogEntryData)entries.get(0);
+                date = latest.getPubTime();
+            }
+            return date;
+        }
+
+        public String getNextLink() {
+            if (more) {
+                int offset = queryForm.getOffset() + queryForm.getCount();
+                offset = (offset < 0) ? 0 : offset;
+                return getQueryLink() + "&offset=" + offset;
+            } else {
+                return null;
+            }
+        }
+
+        public String getPrevLink() {
+            if (queryForm.getOffset() > 0) {
+                int offset = queryForm.getOffset() - queryForm.getCount();
+                offset = (offset < 0) ? 0 : offset;
+                return getQueryLink() + "&offset=" + offset;
+            } else {
+                return null;
+            }
+        }
+
+        private String getQueryLink() {
+            StringBuffer sb = new StringBuffer();
+            sb.append(request.getContextPath());
+            sb.append("/editor/weblogEntryManagement.do"); // TODO: get path from Struts
+            sb.append("?method=query");
+            sb.append("&weblog=");
+            sb.append(getWebsite().getHandle());
+            sb.append("&count=");
+            sb.append(queryForm.getCount());
+            return sb.toString();
+        }
+    }
+}

Modified: incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java Mon Feb  6 06:46:53 2006
@@ -119,6 +119,7 @@
                 null,              // endDate
                 null,              // catName
                 WeblogEntryData.PUBLISHED, // status
+                null,              // sortby (null for pubTime)
                 new Integer(20));  // maxEntries
     }
 
@@ -138,6 +139,7 @@
                 null,              // endDate
                 null,              // catName
                 WeblogEntryData.DRAFT, // status
+                "updateTime",      // sortby 
                 new Integer(20));  // maxEntries
     }
     
@@ -157,6 +159,7 @@
                 null,              // endDate
                 null,              // catName
                 WeblogEntryData.PENDING, // status
+                "updateTime",      // sortby
                 new Integer(20));  // maxEntries
     }
  

Modified: incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java Mon Feb  6 06:46:53 2006
@@ -20,173 +20,155 @@
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.BasePageModel;
 import org.roller.presentation.RollerRequest;
-import org.roller.presentation.RollerSession;
+import org.roller.presentation.weblog.formbeans.WeblogEntryManagementForm;
 import org.roller.util.DateUtil;
 
 /**
  * All data needed to render the edit-weblog page.
  * @author David M Johnson
  */
-public class WeblogQueryPageModel extends BasePageModel
-{
-    private RollerRequest rollerRequest = null;
+public class WeblogQueryPageModel extends BasePageModel {
+    private List               entries = null;
+    private RollerRequest      rollerRequest = null;
     private HttpServletRequest request = null;
-    private WebsiteData website = null;
-    private String category = null;
-    private Date startDate = null;
-    private Date endDate = null;
-    private String status = WeblogEntryData.PUBLISHED;
-    private Integer maxEntries = null;
-
+    private WebsiteData        website = null;
+    private String             category = null;
+    private Date               startDate = null;
+    private Date               endDate = null;
+    private String             status = WeblogEntryData.PUBLISHED;
+    private Integer            maxEntries = null;
+    private boolean            more = false;
+    private WeblogEntryManagementForm    queryForm = null;
+    
     public WeblogQueryPageModel(
             HttpServletRequest request,
             HttpServletResponse response,
             ActionMapping mapping,
-            WebsiteData website, 
-            String categoryId, 
-            String start, 
-            String end,
-            String status,
-            Integer maxEntries) throws RollerException
-    {
+            WebsiteData website,
+            WeblogEntryManagementForm queryForm) throws RollerException {
         super("weblogEntryQuery.title", request, response, mapping);
         rollerRequest = RollerRequest.getRollerRequest(request);
         this.request = request;
-        
+        this.queryForm = queryForm;
         this.website = website;
         
-        if (null != categoryId && !categoryId.equals("")) 
-        {
+        if (null != queryForm.getCategoryId() && !queryForm.getCategoryId().equals("")) {
             WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
-            WeblogCategoryData cd = wmgr.retrieveWeblogCategory(categoryId);
-            category = cd.getPath();          
+            WeblogCategoryData cd = wmgr.retrieveWeblogCategory(queryForm.getCategoryId());
+            category = cd.getPath();
         }
         
-        final DateFormat df = 
-            DateFormat.getDateInstance(DateFormat.SHORT, request.getLocale());
-        if (null != start && start.trim().length() > 0) 
-        {
-            try
-            {
+        final DateFormat df =
+                DateFormat.getDateInstance(DateFormat.SHORT, request.getLocale());
+        String start = queryForm.getStartDateString();
+        if (null != start && start.trim().length() > 0) {
+            try {
                 startDate = DateUtil.getStartOfDay(df.parse(start));
-            }
-            catch (ParseException e)
-            {
+            } catch (ParseException e) {
                 throw new RollerException("ERROR parsing start date.");
             }
         }
-
-        if (null != end && end.trim().length() > 0) 
-        {
-            try
-            {
+        
+        String end = queryForm.getEndDateString();
+        if (null != end && end.trim().length() > 0) {
+            try {
                 endDate = DateUtil.getEndOfDay(df.parse(end));
-            }
-            catch (ParseException e)
-            {
+            } catch (ParseException e) {
                 throw new RollerException("ERROR parsing end date.");
             }
         }
         
         this.status = status;
         this.maxEntries = maxEntries;
+        
+        entries = RollerFactory.getRoller().getWeblogManager().getWeblogEntries(
+                website,
+                startDate,
+                endDate,
+                category,
+                status,
+                queryForm.getSortby(),
+                queryForm.getOffset(),
+                queryForm.getCount() + 1);
+       if (entries.size() > queryForm.getCount()) {
+           more = true;
+           entries.remove(entries.size()-1);
+       }
     }
-
-    public String getBaseURL()
-    {
-		return getRequest().getContextPath();
-	}
-
+    
+    public String getBaseURL() {
+        return getRequest().getContextPath();
+    }
+    
     /**
      * Get recent weblog entries using request parameters to determine
      * username, date, and category name parameters.
      * @return List of WeblogEntryData objects.
      * @throws RollerException
      */
-    public List getRecentWeblogEntries() throws RollerException
-    {
-        return RollerFactory.getRoller().getWeblogManager().getWeblogEntries(
-                    website,
-                    startDate,
-                    endDate,
-                    category,
-                    status,
-                    maxEntries);   
+    public List getRecentWeblogEntries() throws RollerException {
+        return entries;
     }
-
-    public List getCategories() throws Exception
-    {
+    
+    public List getCategories() throws Exception {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
         List categories = RollerFactory.getRoller().getWeblogManager()
-            .getWeblogCategories(rreq.getWebsite());
+        .getWeblogCategories(rreq.getWebsite());
         return categories;
     }
-
-//    public List getHoursList()
-//    {
-//        List ret = new LinkedList();
-//        for (int i=0; i<24; i++)
-//        {
-//            ret.add(new Integer(i));
-//        }
-//        return ret;
-//    }
-//
-//    public List getMinutesList()
-//    {
-//        List ret = new LinkedList();
-//        for (int i=0; i<60; i++)
-//        {
-//            ret.add(new Integer(i));
-//        }
-//        return ret;
-//    }
-//
-//    public List getSecondsList()
-//    {
-//        return getMinutesList();
-//    }
-//
-//    public boolean getHasPagePlugins()
-//    {
-//        return ContextLoader.hasPlugins();
-//    }
-//
-//    public String getEditorPage()
-//    {
-//        // Select editor page selected by user (simple text editor,
-//        // DHTML editor, Ekit Java applet, etc.
-//        String editorPage = rollerRequest.getWebsite().getEditorPage();
-//        if (StringUtils.isEmpty( editorPage ))
-//        {
-//            editorPage = "editor-text.jsp";
-//        }
-//        return editorPage;
-//    }
-//
-//    public CalendarModel getCalendarModel() throws Exception
-//    {
-//        // Determine URL to self
-//        ActionForward selfForward = getMapping().findForward("editWeblog");
-//        String selfUrl= getRequest().getContextPath()+selfForward.getPath();
-//
-//        // Setup weblog calendar model
-//        CalendarModel model = new EditWeblogCalendarModel(
-//                rollerRequest.getRequest(), getResponse(), selfUrl );
-//        model.setDay( rollerRequest.getDate(true) );
-//        return model;
-//    }
-//
-//    public UserData getUser()
-//    {
-//        return rollerRequest.getUser();
-//    }
-//
-//    public int getCommentCount(WeblogEntryData entry) throws Exception
-//    {
-//		// include Spam in comments count
-//		List comments = rollerRequest.getRoller().getWeblogManager().getComments(entry.getId(), false);
-//		if (comments == null) return 0;
-//		return comments.size();
-//	}
+    
+    public Date getEarliestDate() {
+        Date date = null;
+        if (entries.size() > 0) {
+            WeblogEntryData earliest = (WeblogEntryData)entries.get(entries.size()-1);
+            date = earliest.getPubTime();
+        }
+        return date;
+    }
+    
+    public Date getLatestDate() {
+        Date date = null;
+        if (entries.size() > 0) {
+            WeblogEntryData latest = (WeblogEntryData)entries.get(0);
+            date = latest.getPubTime();
+        }
+        return date;
+    }
+    
+    public String getNextLink() {
+        if (more) {
+            int offset = queryForm.getOffset() + queryForm.getCount();
+            offset = (offset < 0) ? 0 : offset;
+            return getQueryLink() + "&offset=" + offset;
+        } else {
+            return null;
+        }
+    }
+    
+    public String getPrevLink() {
+        if (queryForm.getOffset() > 0) {
+            int offset = queryForm.getOffset() - queryForm.getCount();
+            offset = (offset < 0) ? 0 : offset;
+            return getQueryLink() + "&offset=" + offset;
+        } else {
+            return null;
+        }
+    }
+    
+    private String getQueryLink() {
+        StringBuffer sb = new StringBuffer();
+        sb.append(request.getContextPath());
+        if (getWebsite() != null) {
+            sb.append("/editor/weblogQuery.do"); // TODO: get path from Struts
+            sb.append("?method=query");
+            sb.append("&weblog=");
+            sb.append(getWebsite().getHandle());
+        } else {
+            sb.append("/admin/weblogQuery.do"); // TODO: get path from Struts
+            sb.append("?method=query");
+        }
+        sb.append("&count=");
+        sb.append(queryForm.getCount());
+        return sb.toString();
+    }
 }

Added: incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryManagementForm.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryManagementForm.java?rev=375289&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryManagementForm.java (added)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryManagementForm.java Mon Feb  6 06:46:53 2006
@@ -0,0 +1,168 @@
+/*
+ * Created on Feb 3, 2006
+ */
+package org.roller.presentation.weblog.formbeans;
+
+import java.text.DateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.servlet.ServletRequest;
+
+import org.apache.struts.action.ActionMapping;
+
+/**
+ * Form allows user to set Weblog Entry query and export parameters.
+ * 
+ * @struts.form name="weblogEntryManagementForm"
+ * @author Dave Johnson
+ */
+public class WeblogEntryManagementForm
+    extends    org.apache.struts.action.ActionForm
+    implements java.io.Serializable
+{    
+    private String mEndDateString;
+    private String mStartDateString;
+    private String mFileBy = "month";
+    private String mExportFormat = "rss";
+    private String mCategoryId = null;
+    private String mStatus = "ALL";
+    private String mSortby = "pubTime";
+    
+    /** max entries displayed per page */
+    private int count = 30; 
+    
+     /** offset into current query results */
+    private int offset = 0;
+    
+    // TODO : Implement option for RSS2 or Atom
+
+    public void reset( ActionMapping mapping, ServletRequest request)
+    {                
+        // reset time fields to current time
+        Calendar cal = Calendar.getInstance(request.getLocale());
+        Date now = new Date();
+        cal.setTime(now);        
+    
+        DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, request.getLocale());
+        mEndDateString = df.format( now );
+        
+        cal.set(Calendar.DAY_OF_MONTH, 1);
+        mStartDateString = df.format( cal.getTime() );
+    }
+    
+    /**
+     * @return Returns the mStartDateString.
+     */
+    public String getStartDateString()
+    {
+        return this.mStartDateString;
+    }
+    /**
+     * @param startDateString The mStartDateString to set.
+     */
+    public void setStartDateString(String startDateString)
+    {
+        this.mStartDateString = startDateString;
+    }
+    
+    /**
+     * @return Returns the mDateString.
+     */
+    public String getEndDateString()
+    {
+        return this.mEndDateString;
+    }
+    
+    /**
+     * @param dateString The mDateString to set.
+     */
+    public void setEndDateString(String dateString)
+    {
+        this.mEndDateString = dateString;
+    }
+    
+    /**
+     * @return Returns the mFileBy.
+     */
+    public String getFileBy()
+    {
+        return this.mFileBy;
+    }
+    
+    /**
+     * @param fileBy The mFileBy to set.
+     */
+    public void setFileBy(String fileBy)
+    {
+        this.mFileBy = fileBy;
+    }
+    
+    /**
+     * @return Returns the mExportFormat.
+     */
+    public String getExportFormat()
+    {
+        return this.mExportFormat;
+    }
+    
+    /**
+     * @param exportFormat The mExportFormat to set.
+     */
+    public void setExportFormat(String exportFormat)
+    {
+        this.mExportFormat = exportFormat;
+    }
+    /**
+     * @return Returns the category.
+     */
+    public String getCategoryId()
+    {
+        return mCategoryId;
+    }
+    /**
+     * @param category The category to set.
+     */
+    public void setCategoryId(String category)
+    {
+        mCategoryId = category;
+    }
+    /**
+     * @return Returns the status.
+     */
+    public String getStatus()
+    {
+        return mStatus;
+    }
+    /**
+     * @param status The status to set.
+     */
+    public void setStatus(String status)
+    {
+        mStatus = status;
+    }
+
+    public int getCount() {
+        return count;
+    }
+
+    public void setCount(int count) {
+        this.count = count;
+    }
+
+    public int getOffset() {
+        return offset;
+    }
+
+    public void setOffset(int offset) {
+        this.offset = offset;
+    } 
+    
+    public String getSortby() {
+        return mSortby;
+    }
+    
+    public void setSortby(String sortby) {
+        mSortby = sortby;
+    }
+}

Added: incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryQueryForm.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryQueryForm.java?rev=375289&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryQueryForm.java (added)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/WeblogEntryQueryForm.java Mon Feb  6 06:46:53 2006
@@ -0,0 +1,9 @@
+package org.roller.presentation.weblog.formbeans;
+
+/**
+ * @struts.form name="weblogEntryQueryForm"
+ * @author Dave Johnson
+ */
+public class WeblogEntryQueryForm  extends CommentManagementForm 
+    implements java.io.Serializable {
+}

Modified: incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties Mon Feb  6 06:46:53 2006
@@ -1433,6 +1433,13 @@
 weblogEntryQuery.button.query=Filter
 weblogEntryQuery.button.export=Export
 
+weblogEntryQuery.label.sortby=Sort by
+weblogEntryQuery.label.pubTime=Publish time
+weblogEntryQuery.label.updateTime=Update time
+weblogEntryQuery.nowShowing=Displaying {0} weblog entries
+weblogEntryQuery.prev=Previous page
+weblogEntryQuery.next=Next page
+
 # ------------------------------------------------------------------ Weblog Main
 
 weblogMain.search=Search

Modified: incubator/roller/trunk/web/WEB-INF/editor-menu.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/editor-menu.xml?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/editor-menu.xml (original)
+++ incubator/roller/trunk/web/WEB-INF/editor-menu.xml Mon Feb  6 06:46:53 2006
@@ -25,7 +25,7 @@
     <menu name="tabbedmenu.weblog" perms="admin,author,limited">
         <menu-item forward="weblogCreate" name="tabbedmenu.weblog.newEntry" 
                                           perms="admin,author,limited" />
-        <menu-item forward="weblogQuery"  name="tabbedmenu.weblog.archives" 
+        <menu-item forward="weblogEntryManagement"  name="tabbedmenu.weblog.archives" 
                                           perms="admin,author,limited" />
         <menu-item forward="commentManagement" name="tabbedmenu.admin.commentManagement" 
                                           perms="admin" 

Modified: incubator/roller/trunk/web/WEB-INF/tiles-defs.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/tiles-defs.xml?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/tiles-defs.xml (original)
+++ incubator/roller/trunk/web/WEB-INF/tiles-defs.xml Mon Feb  6 06:46:53 2006
@@ -101,9 +101,9 @@
     <put name="sidebar" value="/weblog/WeblogEditSidebar.jsp" />
     <put name="styles" value="/theme/css-sidebar.jsp" />
 </definition>
-<definition name=".WeblogQuery" extends=".tiles-editorpage" >
-    <put name="content" value="/weblog/WeblogQuery.jsp" />
-    <put name="sidebar" value="/weblog/WeblogQuerySidebar.jsp" />
+<definition name=".WeblogEntryManagement" extends=".tiles-editorpage" >
+    <put name="content" value="/weblog/WeblogEntryManagement.jsp" />
+    <put name="sidebar" value="/weblog/WeblogEntryManagementSidebar.jsp" />
     <put name="styles" value="/theme/css-sidebar.jsp" />
 </definition>
 <definition name=".CommentManagement" extends=".tiles-editorpage" >

Modified: incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp (original)
+++ incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp Mon Feb  6 06:46:53 2006
@@ -33,9 +33,25 @@
         <html:text property="searchString" /></input>
     </div>
     <br />
-
-   <%-- ========================================================= --%>
-   <%-- filter by date --%>
+    <br />
+    
+    <div class="sideformrow">
+        <label for="startDateString" class="sideformrow">
+           <fmt:message key="commentManagement.startDate" />:
+        </label>
+        <roller:Date property="startDateString" formName="commentQueryForm"
+            dateFormat='<%= model.getShortDateFormat() %>' />
+    </div>
+        
+    <div class="sideformrow">
+        <label for="endDateString" class="sideformrow">
+           <fmt:message key="commentManagement.endDate" />:
+        </label>
+        <roller:Date property="endDateString" formName="commentQueryForm"
+            dateFormat='<%= model.getShortDateFormat() %>' />
+    </div>
+    <br />
+    <br />
   
     <div class="sideformrow">
         <label for="pendingString" class="sideformrow">
@@ -76,24 +92,6 @@
             <html:radio property="spamString" value="ONLY_SPAM" >
                 <fmt:message key="commentManagement.onlySpam" /></html:radio><br />
         </div>
-    </div>
-    <br />
-    
-    <br />
-    <div class="sideformrow">
-        <label for="startDateString" class="sideformrow">
-           <fmt:message key="commentManagement.startDate" />:
-        </label>
-        <roller:Date property="startDateString" formName="commentQueryForm"
-            dateFormat='<%= model.getShortDateFormat() %>' />
-    </div>
-        
-    <div class="sideformrow">
-        <label for="endDateString" class="sideformrow">
-           <fmt:message key="commentManagement.endDate" />:
-        </label>
-        <roller:Date property="endDateString" formName="commentQueryForm"
-            dateFormat='<%= model.getShortDateFormat() %>' />
     </div>
     <br />
     

Added: incubator/roller/trunk/web/weblog/WeblogEntryManagement.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/weblog/WeblogEntryManagement.jsp?rev=375289&view=auto
==============================================================================
--- incubator/roller/trunk/web/weblog/WeblogEntryManagement.jsp (added)
+++ incubator/roller/trunk/web/weblog/WeblogEntryManagement.jsp Mon Feb  6 06:46:53 2006
@@ -0,0 +1,203 @@
+<%@ include file="/taglibs.jsp" %>
+<%@ page import="org.roller.presentation.weblog.actions.WeblogEntryManagementAction" %>
+<%
+WeblogEntryManagementAction.PageModel model = 
+    (WeblogEntryManagementAction.PageModel)request.getAttribute("model");
+%>
+
+<p class="subtitle">
+    <fmt:message key="weblogEntryQuery.subtitle" >
+        <fmt:param value="${model.website.handle}" />
+    </fmt:message>
+</p>
+<p class="pagetip">
+    <fmt:message key="weblogEntryQuery.tip" />
+</p>
+
+
+<%-- ============================================================= --%>
+<%-- Number of comments and date message --%>
+<%-- ============================================================= --%>
+
+<div class="tablenav">
+
+<div style="float:left;">
+    <fmt:message key="weblogEntryQuery.nowShowing">
+        <fmt:param value="${model.weblogEntryCount}" />
+    </fmt:message>
+</div>
+<div style="float:right;">
+    <fmt:formatDate value="${model.latestDate}" type="both" 
+        dateStyle="short" timeStyle="short" />
+    --- 
+    <fmt:formatDate value="${model.earliestDate}" type="both" 
+        dateStyle="short" timeStyle="short" />
+</div>
+<br />
+
+
+<%-- ============================================================= --%>
+<%-- Next / previous links --%>
+<%-- ============================================================= --%>
+
+<c:choose>
+    <c:when test="${!empty model.prevLink && !empty model.nextLink}">
+        <br /><center>
+            &laquo;
+            <a href='<c:out value="${model.prevLink}" />'>
+                <fmt:message key="weblogEntryQuery.prev" /></a>
+            | <a href='<c:out value="${model.nextLink}" />'>
+                <fmt:message key="weblogEntryQuery.next" /></a>
+            &raquo;
+        </center><br />
+    </c:when>
+    <c:when test="${!empty model.prevLink}">
+        <br /><center>
+            &laquo;
+            <a href='<c:out value="${model.prevLink}" />'>
+                <fmt:message key="weblogEntryQuery.prev" /></a>
+            | <fmt:message key="weblogEntryQuery.next" />
+            &raquo;
+        </center><br />
+    </c:when>
+    <c:when test="${!empty model.nextLink}">
+        <br /><center>
+            &laquo;
+            <fmt:message key="weblogEntryQuery.prev" />
+            | <a class="" href='<c:out value="${model.nextLink}" />'>
+                <fmt:message key="weblogEntryQuery.next" /></a>
+            &raquo;
+        </center><br />
+    </c:when>
+    <c:otherwise><br /></c:otherwise>
+</c:choose>
+
+</div> <%-- class="tablenav" --%>
+
+        
+<%-- ============================================================= --%>
+<%-- Entry table--%>
+<%-- ============================================================= --%>
+
+<table class="rollertable" width="100%">
+    
+<tr>
+    <th class="rollertable">
+        <fmt:message key="weblogEntryQuery.weblogEntries" />
+    </th>
+</tr>
+<tr class="actionrow">
+    <td align="right" valign="center">
+        <span class="draftEntryBox">&nbsp;&nbsp;&nbsp;&nbsp;</span> 
+        <fmt:message key="weblogEntryQuery.draft" />&nbsp;&nbsp;
+        <span class="pendingEntryBox">&nbsp;&nbsp;&nbsp;&nbsp;</span>
+        <fmt:message key="weblogEntryQuery.pending" />&nbsp;&nbsp;
+    </td> 
+</tr>
+
+<c:forEach var="post" items="${model.recentWeblogEntries}">
+    <tr>
+        <%-- <td> with style if comment is spam or pending --%>               
+        <c:choose>
+            <c:when test='${post.status == "DRAFT"}'>
+                <td class="draftentry"> 
+            </c:when>
+            <c:when test='${post.status == "PENDING"}'>
+                <td class="pendingentry"> 
+            </c:when>
+            <c:otherwise>
+                <td>
+            </c:otherwise>
+        </c:choose>
+        
+        <%-- entry details table in table --%>
+        <table style="border:none; padding:0px; margin:0px">                                               
+        <tr> <%-- title --%>
+            <td style="border: none; padding:0px;">
+               <fmt:message key="weblogEntryQuery.title" />
+            </td>
+            <td class="details" style="border: none; padding:0px;">
+                 <c:out value="${post.displayTitle}" />
+                 [<roller:link page="/editor/weblog.do">
+                    <roller:linkparam
+                        id="<%= RollerRequest.WEBLOGENTRYID_KEY %>"
+                        name="post" property="id" />
+                    <roller:linkparam id="method" value="edit" />
+                    <fmt:message key="weblogEntryQuery.edit" />
+                </roller:link>]
+            </td>
+        </tr>                                                                    
+        <c:if test='${post.status == "PUBLISHED"}'>
+            <tr> <%-- link --%>
+                <td style="border: none; padding:0px;">
+                   <fmt:message key="weblogEntryQuery.link" />
+                </td>
+                <td class="details" style="border: none; padding:0px;">
+                    <a href='<c:out value="${model.baseURL}" /><c:out value="${post.permaLink}" />'>
+                        <c:out value="${model.baseURL}" /><c:out value="${post.permaLink}" />
+                    </a>
+                </td>
+            </tr> 
+        </c:if>
+        
+        <tr> <%-- pubtime --%>
+            <td style="border: none; padding:0px;">
+               <fmt:message key="weblogEntryQuery.pubTime" />
+            </td>
+            <td class="details" style="border: none; padding:0px;">
+                <fmt:formatDate value="${post.pubTime}" type="both" 
+                    dateStyle="medium" timeStyle="medium" />
+            </td>
+        </tr>    
+
+        <tr> <%-- updatetime --%>
+            <td style="border: none; padding:0px;">
+               <fmt:message key="weblogEntryQuery.updateTime" />
+            </td>
+            <td class="details" style="border: none; padding:0px;">
+                <fmt:formatDate value="${post.updateTime}" type="both" 
+                    dateStyle="medium" timeStyle="medium" />                  
+            </td>
+        </tr>      
+                                                                                                                                
+        <tr> <%-- category --%>
+            <td style="border: none; padding:0px;">
+               <fmt:message key="weblogEntryQuery.category" />
+            </td>
+            <td class="details" style="border: none; padding:0px;">
+                <c:out value="${post.category.path}" />
+            </td>
+        </tr>  
+                                                                                                                              
+        <tr> <%-- category --%>
+            <td style="border: none; padding:0px;">
+               <fmt:message key="weblogEntryQuery.status" />
+            </td>
+            <td class="details" style="border: none; padding:0px;">
+                 <c:out value="${post.status}" />
+            </td>
+        </tr>
+        
+        </table> <%-- end entry details table in table --%>
+        <br />
+   
+        <div style="overflow:auto">
+            <roller:ApplyPlugins name="post" skipFlag="true" scope="page" />
+        </div>
+        
+    </td></tr>
+</c:forEach>
+</table>
+
+<c:if test="${empty model.recentWeblogEntries}" >
+   <fmt:message key="weblogEntryQuery.noneFound" />
+   <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
+</c:if>
+
+<script type="text/javascript">
+<!--
+try {Start();} catch (e) {};
+-->
+</script>
+
+

Added: incubator/roller/trunk/web/weblog/WeblogEntryManagementSidebar.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/weblog/WeblogEntryManagementSidebar.jsp?rev=375289&view=auto
==============================================================================
--- incubator/roller/trunk/web/weblog/WeblogEntryManagementSidebar.jsp (added)
+++ incubator/roller/trunk/web/weblog/WeblogEntryManagementSidebar.jsp Mon Feb  6 06:46:53 2006
@@ -0,0 +1,124 @@
+<%@ include file="/taglibs.jsp" %>
+
+<%@ page import="org.roller.presentation.weblog.actions.WeblogEntryManagementAction" %>
+<%
+WeblogEntryManagementAction.PageModel model = 
+    (WeblogEntryManagementAction.PageModel)request.getAttribute("model");
+%>
+
+<div class="sidebarFade">
+    <div class="menu-tr">
+        <div class="menu-tl">
+
+<div class="sidebarInner">
+        
+<h3><fmt:message key="weblogEntryQuery.sidebarTitle" /></h3>
+<hr size="1" noshade="noshade" />
+
+<p><fmt:message key="weblogEntryQuery.sidebarDescription" /></p>
+
+<html:form action="/editor/weblogEntryManagement" method="post" focus="title">
+    <input type="hidden" name="weblog" value='<c:out value="${model.website.handle}" />' />
+    <html:hidden name="method" property="method" value="query"/>
+    <html:hidden property="count" />
+    <html:hidden property="offset" />
+
+  <%-- ========================================================= --%>
+  <%-- filter by category --%>
+  
+    <div class="sideformrow">
+        <label for="categoryId" class="sideformrow">
+            <fmt:message key="weblogEntryQuery.label.category" /></label>          
+        <html:select property="categoryId" size="1" tabindex="4">
+            <html:option key="weblogEntryQuery.label.any" value="" />
+            <html:optionsCollection name="model" property="categories" value="id" label="path"  />
+        </html:select>
+    </div>
+    <br />
+    <br />
+
+  <%-- ========================================================= --%>
+  <%-- filter by date --%>
+  
+    <div class="sideformrow">
+        <label for="startDateString" class="sideformrow">
+           <fmt:message key="weblogEntryQuery.label.startDate" />:
+        </label>
+        <roller:Date property="startDateString" dateFormat='<%= model.getShortDateFormat() %>' />
+    </div>
+
+    <div class="sideformrow">
+        <label for="endDateString" class="sideformrow">
+           <fmt:message key="weblogEntryQuery.label.endDate" />:
+        </label>
+        <roller:Date property="endDateString" dateFormat='<%= model.getShortDateFormat() %>' />
+    </div>
+    <br />
+    <br />
+    
+  <%-- ========================================================= --%>
+  <%-- filter by status --%>
+
+    <div class="sideformrow">
+        <label for="status" class="sideformrow">
+            <fmt:message key="weblogEntryQuery.label.status" />:
+            <br />
+            <br />
+            <br />
+            <br />
+            <br />
+            <br />
+        </label> 
+        <div>
+        <html:radio property="status" value="ALL">
+            <fmt:message key="weblogEntryQuery.label.allEntries" /></html:radio> 
+        <br />
+        <html:radio property="status" value="DRAFT">
+            <fmt:message key="weblogEntryQuery.label.draftOnly" /></html:radio>
+        <br />
+        <html:radio property="status" value="PUBLISHED" >
+            <fmt:message key="weblogEntryQuery.label.publishedOnly" /></html:radio>
+        <br />
+        <html:radio property="status" value="PENDING" >
+            <fmt:message key="weblogEntryQuery.label.pendingOnly" /></html:radio>
+        </div>
+    </div>
+
+  <%-- ========================================================= --%>
+  <%-- sort by --%>
+
+    <div class="sideformrow">
+        <label for="status" class="sideformrow">
+            <fmt:message key="weblogEntryQuery.label.sortby" />:
+            <br />
+            <br />
+        </label> 
+        <div>
+        <html:radio property="sortby" value="pubTime">
+            <fmt:message key="weblogEntryQuery.label.pubTime" /></html:radio> 
+        <br />
+        <html:radio property="sortby" value="updateTime">
+            <fmt:message key="weblogEntryQuery.label.updateTime" /></html:radio>
+        </div>
+    </div>
+
+  <%-- ========================================================= --%>
+  <%-- search button --%>
+  
+    <br />
+    <input type="button" name="post"
+        value='<fmt:message key="weblogEntryQuery.button.query" />' 
+        onclick="submit()">
+    </input>
+    
+</html:form>
+
+<br />
+<br />
+</div> <!-- sidebarInner -->
+
+        </div>
+    </div>
+</div>
+
+

Modified: incubator/roller/trunk/web/website/UploadFile.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/website/UploadFile.jsp?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/web/website/UploadFile.jsp (original)
+++ incubator/roller/trunk/web/website/UploadFile.jsp Mon Feb  6 06:46:53 2006
@@ -130,12 +130,12 @@
                
             <div id="lessToggle" style="display:none; float:left;">
                 <a onclick="javascript:toggleLess('fileControl')">
-                   <img src='<c:url value="/images/delete.png"/>' style="padding:4px" title="Add file to upload list" />
+                   <img src='<c:url value="/images/delete.png"/>' style="padding:4px" title="Remove last from upload list" />
                 </a>
             </div>
             <div id="moreToggle" style="display:inline; float:left">
                 <a onclick="javascript:toggleMore('fileControl')">
-                    <img src='<c:url value="/images/add.png"/>' style="padding:4px" title="Remove last from upload list" />
+                    <img src='<c:url value="/images/add.png"/>' style="padding:4px" title="Add file to upload list" />
                 </a>
             </div>
          

Modified: incubator/roller/trunk/web/website/UserAdmin.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/website/UserAdmin.jsp?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/web/website/UserAdmin.jsp (original)
+++ incubator/roller/trunk/web/website/UserAdmin.jsp Mon Feb  6 06:46:53 2006
@@ -174,7 +174,7 @@
                                <fmt:message key="userAdmin.newEntry" /></a>
                        </td>
                        <td width="%15">
-                           <c:url value="/editor/weblogQuery.do" var="editEntries">
+                           <c:url value="/editor/weblogEntryManagement.do" var="editEntries">
                                <c:param name="method" value="query" />
                                <c:param name="weblog" value="${perms.website.handle}" />
                            </c:url>

Modified: incubator/roller/trunk/web/website/YourWebsites.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/website/YourWebsites.jsp?rev=375289&r1=375288&r2=375289&view=diff
==============================================================================
--- incubator/roller/trunk/web/website/YourWebsites.jsp (original)
+++ incubator/roller/trunk/web/website/YourWebsites.jsp Mon Feb  6 06:46:53 2006
@@ -91,7 +91,7 @@
                            <fmt:message key="yourWebsites.newEntry" /></a>
                        <br />
 
-                       <c:url value="/editor/weblogQuery.do" var="editEntries">
+                       <c:url value="/editor/weblogEntryManagement.do" var="editEntries">
                            <c:param name="method" value="query" />
                            <c:param name="weblog" value="${perms.website.handle}" />
                        </c:url>



Mime
View raw message