roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r452925 - in /incubator/roller/branches/roller_3.0: docs/examples/rollertask/ metadata/database/ nbproject/ src/org/apache/roller/pojos/ src/org/apache/roller/ui/authoring/struts/actions/ src/org/apache/roller/ui/rendering/ src/org/apache/r...
Date Wed, 04 Oct 2006 16:32:22 GMT
Author: snoopdave
Date: Wed Oct  4 09:32:20 2006
New Revision: 452925

URL: http://svn.apache.org/viewvc?view=rev&rev=452925
Log:
Merging these fixes from trunk: 452898, 452650, 452649, 452647, 452646, 450572, 450979 and
451053

Modified:
    incubator/roller/branches/roller_3.0/docs/examples/rollertask/rollertask.sh
    incubator/roller/branches/roller_3.0/metadata/database/createdb.vm
    incubator/roller/branches/roller_3.0/nbproject/project.xml
    incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/InvitationsAction.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/WeblogRequestMapper.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
    incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
    incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/admin/UserAdmin.jsp
    incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/Invitations.jsp
    incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/tiles/footer.jsp

Modified: incubator/roller/branches/roller_3.0/docs/examples/rollertask/rollertask.sh
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/docs/examples/rollertask/rollertask.sh?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/docs/examples/rollertask/rollertask.sh (original)
+++ incubator/roller/branches/roller_3.0/docs/examples/rollertask/rollertask.sh Wed Oct  4
09:32:20 2006
@@ -42,9 +42,8 @@
 ${ROLLER_HOME}/WEB-INF/lib/log4j-1.2.11.jar:\
 ${ROLLER_HOME}/WEB-INF/lib/lucene-1.4.3.jar:\
 ${ROLLER_HOME}/WEB-INF/lib/oscache.jar:\
-${ROLLER_HOME}/WEB-INF/lib/rollerbeans.jar:\
-${ROLLER_HOME}/WEB-INF/lib/rollercontrib.jar:\
-${ROLLER_HOME}/WEB-INF/lib/rollerweb.jar:\
+${ROLLER_HOME}/WEB-INF/lib/roller-business.jar:\
+${ROLLER_HOME}/WEB-INF/lib/roller-web.jar:\
 ${ROLLER_HOME}/WEB-INF/lib/rome-0.8.jar:\
 ${ROLLER_HOME}/WEB-INF/lib/rome-fetcher-0.8.jar:\
 ${ROLLER_HOME}/WEB-INF/lib/saxpath.jar:\

Modified: incubator/roller/branches/roller_3.0/metadata/database/createdb.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/metadata/database/createdb.vm?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/metadata/database/createdb.vm (original)
+++ incubator/roller/branches/roller_3.0/metadata/database/createdb.vm Wed Oct  4 09:32:20
2006
@@ -77,7 +77,7 @@
     hidden          $BOOLEAN_SQL_TYPE_FALSE not null,
     navbar          $BOOLEAN_SQL_TYPE_FALSE not null,
     templatelang    varchar(20) not null,
-    decorator       varchar(255) null
+    decorator       varchar(255) default null
 );
 create index wp_name_idx on webpage( name$!INDEXSIZE );
 create index wp_link_idx on webpage( link$!INDEXSIZE );
@@ -113,7 +113,7 @@
     commentmod           $BOOLEAN_SQL_TYPE_FALSE not null,
     displaycnt           integer default 15 not null,
     lastmodified         $TIMESTAMP_SQL_TYPE,
-    pagemodels           varchar(512) default null,
+    pagemodels           varchar(255) default null,
     enablemultilang   $BOOLEAN_SQL_TYPE_FALSE not null,
     showalllangs      $BOOLEAN_SQL_TYPE_TRUE not null
 );
@@ -197,7 +197,7 @@
     status          varchar(20) not null,
     summary         $TEXT_SQL_TYPE default null, 
     content_type    varchar(48) default null, 
-    content_src     varchar(512) default null
+    content_src     varchar(255) default null
 );
 create index we_websiteid_idx on weblogentry( websiteid );
 create index we_categoryid_idx on weblogentry( categoryid );

Modified: incubator/roller/branches/roller_3.0/nbproject/project.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/nbproject/project.xml?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/nbproject/project.xml (original)
+++ incubator/roller/branches/roller_3.0/nbproject/project.xml Wed Oct  4 09:32:20 2006
@@ -4,7 +4,7 @@
     <configuration>
         <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
             <!--Do not use Project Properties customizer when editing this file manually.-->
-            <name>roller</name>
+            <name>roller_3.0</name>
             <!--
             <properties>
                 <property name="src.dir">../src</property>

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java Wed
Oct  4 09:32:20 2006
@@ -22,12 +22,12 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
+import java.util.TreeMap;
 import org.apache.commons.lang.StringUtils;
 import org.apache.roller.RollerException;
 import org.apache.roller.model.RefererManager;
@@ -43,8 +43,6 @@
 import org.apache.roller.model.ThemeManager;
 import org.apache.roller.model.UserManager;
 import org.apache.roller.model.WeblogManager;
-import org.apache.roller.pojos.wrapper.RefererDataWrapper;
-
 
 /**
  * Website has many-to-many association with users. Website has one-to-many and
@@ -322,7 +320,7 @@
      */
     public List getPages() {
         
-        Map pages = new HashMap();
+        Map pages = new TreeMap();
         
         // first get the pages from the db
         try {

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/InvitationsAction.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/InvitationsAction.java?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/InvitationsAction.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/InvitationsAction.java
Wed Oct  4 09:32:20 2006
@@ -113,8 +113,8 @@
         Roller roller = RollerFactory.getRoller();
         UserManager umgr = roller.getUserManager();
         PermissionsData perms = umgr.getPermissions(invitationForm.getPermissionId());
+        ActionErrors errors = new ActionErrors();
         if (perms == null) {
-            ActionErrors errors = new ActionErrors();
             errors.add(null, new ActionError("invitations.error.notFound"));
             saveErrors(request, errors);
             return view(mapping, actionForm, request, response);
@@ -123,7 +123,12 @@
         if (rses.isUserAuthorizedToAdmin(perms.getWebsite())) {
             umgr.removePermissions(perms);
             roller.flush();
-            notifyInvitee(request, perms.getWebsite(), perms.getUser());
+            try {
+                notifyInvitee(request, perms.getWebsite(), perms.getUser());
+            } catch (RollerException e) {
+                errors.add(ActionErrors.GLOBAL_ERROR,
+                        new ActionError("error.untranslated", e.getMessage()));
+            }
             ActionMessages msgs = new ActionMessages();
             msgs.add(ActionMessages.GLOBAL_MESSAGE, 
                 new ActionMessage("invitations.revoked"));

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java
Wed Oct  4 09:32:20 2006
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.util.Date;
 import java.util.List;
+import java.util.ResourceBundle;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -34,7 +35,6 @@
 import org.apache.roller.RollerPermissionsException;
 import org.apache.roller.model.RollerFactory;
 import org.apache.roller.model.UserManager;
-import org.apache.roller.pojos.Template;
 import org.apache.roller.pojos.UserData;
 import org.apache.roller.pojos.WeblogTemplate;
 import org.apache.roller.pojos.WebsiteData;
@@ -64,6 +64,8 @@
  * @struts.action-forward name="editPages.page" path=".edit-pages"
  */
 public final class WeblogTemplateFormAction extends DispatchAction {
+    protected static ResourceBundle bundle = 
+        ResourceBundle.getBundle("ApplicationResources"); 
     private static Log mLogger =
             LogFactory.getFactory().getInstance(WeblogTemplateFormAction.class);
     
@@ -86,8 +88,8 @@
                 form.copyTo(data, request.getLocale());
                 data.setWebsite(website);
                 data.setLastModified( new Date() );
-                data.setDescription("");
-                data.setContents("");
+                data.setDescription(data.getName());
+                data.setContents(bundle.getString("pageForm.newTemplateContent"));
                 validateLink( data );
                 
                 // all templates start out as velocity templates

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/WeblogRequestMapper.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/WeblogRequestMapper.java?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/WeblogRequestMapper.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/WeblogRequestMapper.java
Wed Oct  4 09:32:20 2006
@@ -89,6 +89,10 @@
     public boolean handleRequest(HttpServletRequest request, HttpServletResponse response)
             throws ServletException, IOException {
         
+        // kinda silly, but we need to keep track of whether or not the url had
+        // a trailing slash so that we can act accordingly
+        boolean trailingSlash = false;
+        
         String weblogHandle = null;
         String weblogLocale = null;
         String weblogRequestContext = null;
@@ -107,6 +111,7 @@
             // strip off trailing slash if needed
             if(servlet.endsWith("/")) {
                 servlet = servlet.substring(0, servlet.length() - 1);
+                trailingSlash = true;
             }
             
             if(servlet.indexOf("/") != -1) {
@@ -165,6 +170,29 @@
                 }
             }
             
+        }
+        
+        // special handling for trailing slash issue
+        // we need this because by http standards the urls /foo and /foo/ are
+        // supposed to be considered different, so we must enforce that
+        if(weblogRequestContext == null && !trailingSlash) {
+            // this means someone referred to a weblog index page with the 
+            // shortest form of url /<weblog> or /<weblog>/<locale> and
we need
+            // to do a redirect to /<weblog>/ or /<weblog>/<locale>/
+            String redirectUrl = request.getRequestURI() + "/";
+            if(request.getQueryString() != null) {
+                redirectUrl += "?"+request.getQueryString();
+            }
+            
+            response.sendRedirect(redirectUrl);
+            return true;
+            
+        } else if(weblogRequestContext != null && trailingSlash) {
+            // this means that someone has accessed a weblog url and included
+            // a trailing slash, like /<weblog>/entry/<anchor>/ which is not
+            // supported, so we need to offer up a 404 Not Found
+            response.sendError(HttpServletResponse.SC_NOT_FOUND);
+            return true;
         }
         
         // calculate forward url

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
Wed Oct  4 09:32:20 2006
@@ -168,13 +168,18 @@
             lastModified = weblog.getLastModified().getTime();
         }
 
-        // Respond with 304 Not Modified if it is not modified.
-        if (ModDateHeaderUtil.respondIfNotModified(request,response,lastModified)) {
-            return;
+        // 304 Not Modified handling.
+        // We skip this for logged in users to avoid the scenerio where a user
+        // views their weblog, logs in, then gets a 304 without the 'edit' links
+        if(!pageRequest.isLoggedIn()) {
+            if (ModDateHeaderUtil.respondIfNotModified(request,response,lastModified)) {
+                return;
+            } else {
+                // set last-modified date
+                ModDateHeaderUtil.setLastModifiedHeader(response,lastModified);
+            }
         }
 
-        // set last-modified date
-        ModDateHeaderUtil.setLastModifiedHeader(response,lastModified);
                 
         // generate cache key
         String cacheKey = null;

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
Wed Oct  4 09:32:20 2006
@@ -591,6 +591,9 @@
 invitations.prompt=This page lists the outstanding invitations in this weblog. \
 You may choose to cancel invitations and if email notification is enabled the \
 uninvited party will receive a invitation revoked message.
+invitations.revoke=Cancel
+invitations.noInvitations=No invitations
+invitations.confirm.revoke=Revoke selected invitations? 
 
 invitations.revokationSubject=Roller: invitation to join weblog "{0}" ({1}) \
 REVOKED
@@ -872,6 +875,7 @@
 pageForm.description=Description
 pageForm.template=Template
 pageForm.save=Save
+pageForm.newTemplateContent=<html><body></body></html>
 pageForm.save.success=Template updated successfully.
 pagesForm.column.navbar=Navbar
 pagesForm.column.hidden=Hidden

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/admin/UserAdmin.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/admin/UserAdmin.jsp?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/admin/UserAdmin.jsp (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/admin/UserAdmin.jsp Wed Oct  4 09:32:20
2006
@@ -183,7 +183,7 @@
                                <c:param name="method" value="create" />
                                <c:param name="weblog" value="${perms.website.handle}"
/>
                            </c:url>
-                           <img src='<c:url value="/images/page_white_edit.gif"/>'
/>
+                           <img src='<c:url value="/images/page_white_edit.png"/>'
/>
                            <a href='<c:out value="${newEntry}" />'>
                                <fmt:message key="userAdmin.newEntry" /></a>
                        </td>

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/Invitations.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/Invitations.jsp?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/Invitations.jsp (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/Invitations.jsp Wed Oct
 4 09:32:20 2006
@@ -20,7 +20,7 @@
 <script type="text/javascript">
 // <!--
 function revokeInvite(id) {
-    if (confirm("Revoke selected invitation?")) {
+    if (confirm('<fmt:message key="invitations.confirm.revoke" />')) {
         document.invitationsForm.method.value="revoke"; 
         document.invitationsForm.permissionId.value=id; 
         document.invitationsForm.submit();
@@ -40,14 +40,14 @@
 </p>
 <p><fmt:message key="invitations.prompt" /></p>
 
-<html:form action="/roller-ui/authoring/invitations" method="post" focus="userName">
+<html:form action="/roller-ui/authoring/invitations" method="post">
     <html:hidden property="weblog" />
     <html:hidden property="permissionId" />
     <input type="hidden" name="method" value="view" />
         
     <c:choose>
         <c:when test="${empty model.pendings}"> 
-            No invitations
+            <fmt:message key="invitations.noInvitations" />
         </c:when>  
         <c:when test="${!empty model.pendings}">  
             <table class="rollertable">
@@ -79,7 +79,9 @@
                             <c:if test="${invite.permissionMask == 3}" >ADMIN</c:if>
                         </td> 
                         <td class="rollertable">
-                            <a hrerf="#" onclick="revokeInvite('<c:out value="${invite.id}"
/>')">Revoke</a>
+                            <a hrerf="#" onclick="revokeInvite('<c:out value="${invite.id}"
/>')">
+                                <fmt:message key="invitations.revoke" />
+                            </a>
                         </td> 
                     </roller:row>
                 </c:forEach>

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/tiles/footer.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/tiles/footer.jsp?view=diff&rev=452925&r1=452924&r2=452925
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/tiles/footer.jsp (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/tiles/footer.jsp Wed Oct  4 09:32:20
2006
@@ -23,11 +23,8 @@
 <a href="http://opensource2.atlassian.com/projects/roller/">
     <fmt:message key="footer.reportIssue" /></a> | 
 
-<a href="http://www.rollerweblogger.org/wiki/Wiki.jsp?page=UserGuide_2.x">
+<a href="http://www.rollerweblogger.org/wiki/Wiki.jsp?page=UserGuide">
     <fmt:message key="footer.userGuide" /></a> | 
-
-<a href="http://www.rollerweblogger.org/velocidoc/">
-    <fmt:message key="footer.macros" /></a> | 
 
 <a href="http://rollerweblogger.org/wiki/Wiki.jsp?page=RollerMailingLists">
     <fmt:message key="footer.mailingLists" /></a>



Mime
View raw message