roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r581071 - in /roller/branches/roller_4.1_dev/apps/weblogger: ./ custom/ src/java/org/apache/roller/weblogger/config/ src/java/org/apache/roller/weblogger/pojos/ src/java/org/apache/roller/weblogger/ui/struts2/editor/ src/java/org/apache/rol...
Date Mon, 01 Oct 2007 21:06:34 GMT
Author: snoopdave
Date: Mon Oct  1 14:06:32 2007
New Revision: 581071

URL: http://svn.apache.org/viewvc?rev=581071&view=rev
Log:
More ext. user mgmt work, more userid removals.

Modified:
    roller/branches/roller_4.1_dev/apps/weblogger/build.properties
    roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-jars.xmlf
    roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-src-web.xmlf
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.orm.xml
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
    roller/branches/roller_4.1_dev/apps/weblogger/src/sql/400-to-410-migration.vm
    roller/branches/roller_4.1_dev/apps/weblogger/src/sql/createdb.vm
    roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/TestUtils.java
    roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java
    roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java
    roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java
    roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/webservices/xmlrpc/RollerXmlRpcServerTest.java

Modified: roller/branches/roller_4.1_dev/apps/weblogger/build.properties
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/build.properties?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/build.properties (original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/build.properties Mon Oct  1 14:06:32 2007
@@ -9,7 +9,7 @@
 build.debug=true
 build.sourcelevel=1.5
 build.deprecation=false
-junit.haltonerror=false
+junit.haltonerror=true
 
 # automated testing contorls
 

Modified: roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-jars.xmlf
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-jars.xmlf?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-jars.xmlf (original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-jars.xmlf Mon Oct  1 14:06:32
2007
@@ -4,3 +4,10 @@
 <!-- EXAMPLE: jdobackend libraries
 <fileset dir="${basedir}/sandbox/jdobackend/lib" includes="*.jar" />
 -->
+
+<fileset dir="/Users/dave/src/socialfish_head/swap/components/userapi/dist" includes="*.jar"
/>
+
+<fileset dir="/Users/dave/src/socialfish_head/swap/components/discoapi/dist" includes="*.jar"
/>
+<fileset dir="/Users/dave/src/socialfish_head/swap/components/discoapi/lib" includes="http-client-*.jar"
/>
+<fileset dir="/Users/dave/src/socialfish_head/swap/components/discoapi/lib" includes="rome-*.jar"
/>
+<fileset dir="/Users/dave/src/socialfish_head/swap/components/discoapi/lib" includes="jersey.jar"
/>

Modified: roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-src-web.xmlf
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-src-web.xmlf?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-src-web.xmlf (original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/custom/custom-src-web.xmlf Mon Oct  1 14:06:32
2007
@@ -2,8 +2,7 @@
     Example: custom classes to include in roller-web.jar
     Your classes must be under the package org/apache/roller/weblogger/ui/
  -->
-<!--
-<src dir="${basedir}/custom/src" />
--->
-
 
+<src path="${basedir}/custom/src/java" />
+<include name="javanet/socialfish/roller/ui/**" />
+<include name="javanet/socialfish/roller/discoapi/**" />

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties
Mon Oct  1 14:06:32 2007
@@ -50,7 +50,7 @@
 # -- Feature specific settings
 # -- Scheduled tasks configuration
 # -- Cache configuratation
-# -- Security settings
+# -- User management and security settings
 # -- Rendering system
 # -- Weblog ping system
 # -- Pluggable backend, page and editor plugins
@@ -339,6 +339,19 @@
 # Enables HTTPS for login page only
 securelogin.enabled=false
 
+# Enable container managed authentication
+authentication.cma.enabled=false
+
+# Password security settings
+passwds.encryption.enabled=true
+passwds.encryption.algorithm=SHA
+
+# Role to globbal permissions mappings
+role.names=anonymous,editor,admin
+role.action.anonymous=comment
+role.action.editor=login,comment,createWeblog
+role.action.admin=login,comment,createWeblog,admin
+
 # Enable scheme enforcement?
 # Scheme enforcement ensures that specific URLs are viewed only via HTTPS
 schemeenforcement.enabled=false
@@ -353,19 +366,6 @@
 /roller-ui/admin/createUser.rol,/roller-ui/admin/createUser!save.rol,\
 /roller-ui/authoring/userdata,\
 /roller-ui/authoring/membersInvite.rol,/roller-ui/authoring/membersInvite!save.rol
-
-# Password security settings
-passwds.encryption.enabled=true
-passwds.encryption.algorithm=SHA
-
-# Enable container managed authentication
-authentication.cma.enabled=false
-
-# Role to globbal permissions mappings
-role.names=anonymous,editor,admin
-role.action.anonymous=comment
-role.action.editor=login,comment,createWeblog
-role.action.admin=login,comment,createWeblog,admin
 
 #----------------------------------
 # Single-Sign-On

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
Mon Oct  1 14:06:32 2007
@@ -92,9 +92,9 @@
     private Boolean   pinnedToMain  = Boolean.FALSE;
     private String    status        = DRAFT;
     private String    locale        = null;
-    
+    private String    creatorUserName = null;      
+
     // Associated objects
-    private User           creator  = null;
     private Weblog        website  = null;
     private WeblogCategory category = null;
     
@@ -126,7 +126,7 @@
         //this.id = id;
         this.category = category;
         this.website = website;
-        this.creator = creator;
+        this.creatorUserName = creator.getUserName();
         this.title = title;
         this.link = link;
         this.text = text;
@@ -147,23 +147,23 @@
      */
     public void setData(WeblogEntry other) {
         
-        this.id = other.getId();
-        this.category = other.getCategory();
-        this.website = other.getWebsite();
-        this.creator = other.getCreator();
-        this.title = other.getTitle();
-        this.link = other.getLink();
-        this.text = other.getText();
-        this.anchor = other.getAnchor();
-        this.pubTime = other.getPubTime();
-        this.updateTime = other.getUpdateTime();
-        this.status = other.getStatus();
-        this.plugins = other.getPlugins();
-        this.allowComments = other.getAllowComments();
-        this.commentDays = other.getCommentDays();
-        this.rightToLeft = other.getRightToLeft();
-        this.pinnedToMain = other.getPinnedToMain();
-        this.locale = other.getLocale();
+        this.setId(other.getId());
+        this.setCategory(other.getCategory());
+        this.setWebsite(other.getWebsite());
+        this.setCreatorUserName(other.getCreatorUserName());
+        this.setTitle(other.getTitle());
+        this.setLink(other.getLink());
+        this.setText(other.getText());
+        this.setAnchor(other.getAnchor());
+        this.setPubTime(other.getPubTime());
+        this.setUpdateTime(other.getUpdateTime());
+        this.setStatus(other.getStatus());
+        this.setPlugins(other.getPlugins());
+        this.setAllowComments(other.getAllowComments());
+        this.setCommentDays(other.getCommentDays());
+        this.setRightToLeft(other.getRightToLeft());
+        this.setPinnedToMain(other.getPinnedToMain());
+        this.setLocale(other.getLocale());
     }
     
     //------------------------------------------------------- Good citizenship
@@ -172,9 +172,9 @@
         StringBuffer buf = new StringBuffer();
         buf.append("{");
         buf.append(this.id);
-        buf.append(", ").append(this.anchor);
-        buf.append(", ").append(this.title);
-        buf.append(", ").append(this.pubTime);
+        buf.append(", ").append(this.getAnchor());
+        buf.append(", ").append(this.getTitle());
+        buf.append(", ").append(this.getPubTime());
         buf.append("}");
         return buf.toString();
     }
@@ -261,17 +261,23 @@
     
     /**
      * @roller.wrapPojoMethod type="simple"
-     * @ejb:persistent-field
-     * @hibernate.many-to-one column="userid" cascade="none" not-null="true"
      */
     public User getCreator() {
-        return this.creator;
-    }
+        try {
+            return WebloggerFactory.getWeblogger().getUserManager().getUserByUserName(getCreatorUserName());
+        } catch (Exception e) {
+            mLogger.error("ERROR fetching user object for username: " + getCreatorUserName(),
e);
+        }
+        return null;
+    }   
     
-    /** @ejb:persistent-field */
-    public void setCreator(User creator) {
-        this.creator = creator;
+    public String getCreatorUserName() {
+        return creatorUserName;
     }
+
+    public void setCreatorUserName(String creatorUserName) {
+        this.creatorUserName = creatorUserName;
+    }   
     
     /**
      * @roller.wrapPojoMethod type="simple"
@@ -667,7 +673,7 @@
 
         WeblogEntryTag tag = new WeblogEntryTag();
         tag.setName(name);
-        tag.setUser(getCreator());
+        tag.setCreatorUserName(getCreatorUserName());
         tag.setWeblog(getWebsite());
         tag.setWeblogEntry(this);
         tag.setTime(getUpdateTime());
@@ -1233,5 +1239,7 @@
     
     /** No-op method to please XDoclet */
     public void setDisplayContent(String ignored) {}
+
+
     
 }

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml
Mon Oct  1 14:06:32 2007
@@ -132,14 +132,14 @@
             <basic name="locale">
                 <column name="locale" insertable="true" updatable="true" unique="false"/>
             </basic>
+            <basic name="creatorUserName">
+                <column name="creator" insertable="true" updatable="true" unique="false"
/>
+            </basic>
             <many-to-one name="category" target-entity="org.apache.roller.weblogger.pojos.WeblogCategory">
                 <join-column name="categoryid" insertable="true" updatable="true" nullable="false"/>
             </many-to-one>
             <many-to-one name="website" target-entity="org.apache.roller.weblogger.pojos.Weblog">
                 <join-column name="websiteid" insertable="true" updatable="true" nullable="false"/>
-            </many-to-one>
-            <many-to-one name="creator" target-entity="org.apache.roller.weblogger.pojos.User">
-                <join-column name="userid" insertable="true" updatable="true" nullable="false"/>
             </many-to-one>
             <one-to-many name="entryAttributes" mapped-by="entry" target-entity="org.apache.roller.weblogger.pojos.WeblogEntryAttribute"
fetch="LAZY">
                 <cascade>

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java
Mon Oct  1 14:06:32 2007
@@ -22,22 +22,25 @@
 import java.sql.Timestamp;
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.roller.util.UUIDGenerator;
+import org.apache.roller.weblogger.business.WebloggerFactory;
 
 
 /**
  * Tag bean.
- *
  * @author Elias Torres
  */
 public class WeblogEntryTag implements Serializable {
+    private static Log log = LogFactory.getLog(WeblogEntryTag.class);    
     
     private static final long serialVersionUID = -2602052289337573384L;
     
     private String id = UUIDGenerator.generateUUID();
     private Weblog website = null;
     private WeblogEntry weblogEntry = null;
-    private User user = null;
+    private String userName = null;
     private String name = null;
     private Timestamp time = null;
     
@@ -45,14 +48,17 @@
     public WeblogEntryTag() {
     }
     
-    public WeblogEntryTag(String id,
-            Weblog website,WeblogEntry weblogEntry,
-            User user, String name,
+    public WeblogEntryTag(
+            String id,
+            Weblog website,
+            WeblogEntry weblogEntry,
+            User user, 
+            String name,
             Timestamp time) {
         //this.id = id;
         this.website = website;
         this.weblogEntry = weblogEntry;
-        this.user = user;
+        this.userName = user.getUserName();
         this.name = name;
         this.time = time;
     }
@@ -93,11 +99,20 @@
     
     
     public User getUser() {
-        return this.user;
+        try {
+            return WebloggerFactory.getWeblogger().getUserManager().getUserByUserName(getCreatorUserName());
+        } catch (Exception e) {
+            log.error("ERROR fetching user object for username: " + getCreatorUserName(),
e);
+        }
+        return null;
     }
     
-    public void setUser( User user ) {
-        this.user = user;
+    public String getCreatorUserName() {
+        return userName;
+    }
+
+    public void setCreatorUserName(String userName) {
+        this.userName = userName;
     }
     
     /**
@@ -148,5 +163,5 @@
         .append(getWeblogEntry())
         .toHashCode();
     }
-    
+
 }

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.orm.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.orm.xml?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.orm.xml
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.orm.xml
Mon Oct  1 14:06:32 2007
@@ -25,14 +25,14 @@
             <basic name="time">
                 <column name="time" insertable="true" updatable="true" unique="false"/>
             </basic>
+            <basic name="creatorUserName">
+                <column name="creator" insertable="true" updatable="true" unique="false"/>
+            </basic>
             <many-to-one name="weblog" target-entity="org.apache.roller.weblogger.pojos.Weblog">
                 <join-column name="websiteid" insertable="true" updatable="true" nullable="false"/>
             </many-to-one>
             <many-to-one name="weblogEntry" target-entity="org.apache.roller.weblogger.pojos.WeblogEntry">
                 <join-column name="entryid" insertable="true" updatable="true"/>
-            </many-to-one>
-            <many-to-one name="user" target-entity="org.apache.roller.weblogger.pojos.User">
-                <join-column name="userid" insertable="true" updatable="true"/>
             </many-to-one>
         </attributes>
     </entity>

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
Mon Oct  1 14:06:32 2007
@@ -117,7 +117,7 @@
             WeblogEntryManager weblogMgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
             
             WeblogEntry entry = new WeblogEntry();
-            entry.setCreator(getAuthenticatedUser());
+            entry.setCreatorUserName(getAuthenticatedUser().getUserName());
             entry.setWebsite(getActionWeblog());
             
             // set updatetime & pubtime if it was specified

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
Mon Oct  1 14:06:32 2007
@@ -15,13 +15,14 @@
  */
 package org.apache.roller.weblogger.webservices.adminprotocol;
 
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import java.util.ArrayList;
+import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.UserManager;
+import org.apache.roller.weblogger.pojos.GlobalPermission;
 import org.apache.roller.weblogger.pojos.User;
 
 /**
@@ -57,8 +58,10 @@
             if (!password.trim().equals(realpassword)) {
                 throw new UnauthorizedException("ERROR: User is not authorized: " + userName);
             }
-
-            if (!WebloggerFactory.getWeblogger().getUserManager().hasRole("admin", ud)) {
+            List<String> adminActions = new ArrayList<String>();
+            adminActions.add("admin");
+            GlobalPermission adminPerm = new GlobalPermission(ud, adminActions);
+            if (!WebloggerFactory.getWeblogger().getUserManager().checkPermission(adminPerm,
ud)) {
                 throw new UnauthorizedException("ERROR: User must have the admin role to
use the RAP endpoint: " + userName);
             }
             if (!ud.getEnabled().booleanValue()) {

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
Mon Oct  1 14:06:32 2007
@@ -519,7 +519,7 @@
             WeblogEntryManager mgr = roller.getWeblogEntryManager();
             WeblogEntry rollerEntry = new WeblogEntry();
             rollerEntry.setWebsite(website);
-            rollerEntry.setCreator(this.user);
+            rollerEntry.setCreatorUserName(this.user.getUserName());
             copyToRollerEntry(entry, rollerEntry);
             mgr.saveWeblogEntry(rollerEntry);
             roller.flush();

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
Mon Oct  1 14:06:32 2007
@@ -402,7 +402,7 @@
             entry.setPubTime(current);
             entry.setUpdateTime(current);
             User user = roller.getUserManager().getUserByUserName(userid);
-            entry.setCreator(user);
+            entry.setCreatorUserName(user.getUserName());
             entry.setWebsite(website);
             entry.setCategory(website.getBloggerCategory());
             entry.setCommentDays(new Integer(website.getDefaultCommentDays()));

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
Mon Oct  1 14:06:32 2007
@@ -247,7 +247,7 @@
             entry.setPubTime(new Timestamp(dateCreated.getTime()));
             entry.setUpdateTime(current);
             entry.setWebsite(website);
-            entry.setCreator(user);
+            entry.setCreatorUserName(user.getUserName());
             entry.setCommentDays(new Integer(website.getDefaultCommentDays()));
             if (Boolean.valueOf(publish).booleanValue()) {
                 entry.setStatus(WeblogEntry.PUBLISHED);

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/sql/400-to-410-migration.vm
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/sql/400-to-410-migration.vm?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/sql/400-to-410-migration.vm (original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/sql/400-to-410-migration.vm Mon Oct
 1 14:06:32 2007
@@ -34,7 +34,18 @@
       where p.user_id = u.id and p.website_id = w.id and permission_mask = 3;
 
 -- User management can now be exernalized, so no more relations with user table
+
 #dropNotNullFromColumn("userrole" "userid" "varchar(48)")
+
+#dropNotNullFromColumn("website" "creator" "varchar(48)")
 #addColumnNull("website" "creator" "varchar(255)")
 update website as w set creator = (select u.username from rolleruser as u where u.id = w.userid);
+
+#dropNotNullFromColumn("weblogentry" "userid" "varchar(48)")
+#addColumnNull("weblogentry" "creator" "varchar(255)")
+update weblogentry as w set creator = (select u.username from rolleruser as u where u.id
= w.userid);
+
+#dropNotNullFromColumn("roller_weblogentrytag" "userid" "varchar(48)")
+#addColumnNull("roller_weblogentrytag" "creator" "varchar(255)")
+update roller_weblogentrytag as w set creator = (select u.username from rolleruser as u where
u.id = w.userid);
 

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/sql/createdb.vm
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/sql/createdb.vm?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/sql/createdb.vm (original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/sql/createdb.vm Mon Oct  1 14:06:32
2007
@@ -27,10 +27,8 @@
 create table userrole (
     id               varchar(48) not null primary key,
     rolename         varchar(255) not null,
-    username         varchar(255) not null,
-    userid           varchar(48)
+    username         varchar(255) not null
 );
-create index ur_userid_idx on userrole( userid );
 create index ur_username_idx on userrole( username$!db.INDEXSIZE );
 
 -- actions: comma separated list of actions permitted by permission
@@ -193,8 +191,8 @@
 
 create table weblogentry (
     id              varchar(48)  not null primary key,
-    userid          varchar(48) not null,
     anchor          varchar(255)  not null,
+    creator         varchar(255)  not null,
     title           varchar(255)  not null,
     text            $db.TEXT_SQL_TYPE not null,
     pubtime         $db.TIMESTAMP_SQL_TYPE_NULL,
@@ -217,7 +215,7 @@
 create index we_websiteid_idx on weblogentry( websiteid );
 create index we_categoryid_idx on weblogentry( categoryid );
 create index we_pinnedtom_idx on weblogentry(pinnedtomain);
-create index we_userid_idx on weblogentry(userid);
+create index we_creator_idx on weblogentry(creator);
 create index we_status_idx on weblogentry(status);
 create index we_locale_idx on weblogentry(locale);
 create index we_combo1_idx on weblogentry(status, pubtime, websiteid);
@@ -227,14 +225,14 @@
     id              varchar(48)   not null primary key,
     entryid         varchar(48)   not null,
     websiteid       varchar(48)   not null,    
-    userid		    varchar(48)   not null,
+    creator	        varchar(255)   not null,
     name            varchar(255)  not null,
     time            $db.TIMESTAMP_SQL_TYPE 	not null
 );
 
 create index wet_entryid_idx on roller_weblogentrytag( entryid );
 create index wet_websiteid_idx on roller_weblogentrytag( websiteid );
-create index wet_userid_idx on roller_weblogentrytag( userid );
+create index wet_username_idx on roller_weblogentrytag( username );
 create index wet_name_idx on roller_weblogentrytag( name );
 
 create table roller_weblogentrytagagg (

Modified: roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/TestUtils.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/TestUtils.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/TestUtils.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/TestUtils.java
Mon Oct  1 14:06:32 2007
@@ -294,7 +294,7 @@
         testEntry.setUpdateTime(new java.sql.Timestamp(new java.util.Date().getTime()));
         testEntry.setStatus(WeblogEntry.PUBLISHED);
         testEntry.setWebsite(getManagedWebsite(weblog));
-        testEntry.setCreator(getManagedUser(user));
+        testEntry.setCreatorUserName(getManagedUser(user).getUserName());
         testEntry.setCategory(cat);
         
         // store entry

Modified: roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java
Mon Oct  1 14:06:32 2007
@@ -57,7 +57,7 @@
         WeblogEntry wd1 = new WeblogEntry();            
         wd1.setId("dummy1");
         wd1.setAnchor("dummy1");
-        wd1.setCreator(user);
+        wd1.setCreatorUserName(user.getUserName());
         wd1.setUpdateTime(new Timestamp(System.currentTimeMillis()));
         wd1.setPubTime(new Timestamp(System.currentTimeMillis()));
         wd1.setTitle("The Tholian Web");
@@ -72,7 +72,7 @@
         WeblogEntry wd2 = new WeblogEntry();
         wd2.setId("dummy2");
         wd2.setAnchor("dummy2");
-        wd2.setCreator(user);
+        wd2.setCreatorUserName(user.getUserName());
         wd2.setUpdateTime(new Timestamp(System.currentTimeMillis()));
         wd2.setPubTime(new Timestamp(System.currentTimeMillis()));
         wd2.setTitle("A Piece of the Action");

Modified: roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java
Mon Oct  1 14:06:32 2007
@@ -68,7 +68,7 @@
             testEntry1.setPubTime(new Timestamp(new Date().getTime()));
             testEntry1.setUpdateTime(new Timestamp(new Date().getTime()));
             testEntry1.setWebsite(testWeblog);
-            testEntry1.setCreator(testUser);
+            testEntry1.setCreatorUserName(testUser.getUserName());
             testEntry1.setCategory(testWeblog.getDefaultCategory());
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry1);
 
@@ -80,7 +80,7 @@
             testEntry2.setPubTime(new Timestamp(new Date().getTime()));
             testEntry2.setUpdateTime(new Timestamp(new Date().getTime()));
             testEntry2.setWebsite(testWeblog);
-            testEntry2.setCreator(testUser);
+            testEntry2.setCreatorUserName(testUser.getUserName());
             testEntry2.setCategory(testWeblog.getDefaultCategory());
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry1);
 
@@ -92,7 +92,7 @@
             testEntry3.setPubTime(new Timestamp(new Date().getTime()));
             testEntry3.setUpdateTime(new Timestamp(new Date().getTime()));
             testEntry3.setWebsite(testWeblog);
-            testEntry3.setCreator(testUser);
+            testEntry3.setCreatorUserName(testUser.getUserName());
             testEntry3.setCategory(testWeblog.getDefaultCategory());           
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry1);
 

Modified: roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java
Mon Oct  1 14:06:32 2007
@@ -111,7 +111,7 @@
         testEntry.setPubTime(new java.sql.Timestamp(new java.util.Date().getTime()));
         testEntry.setUpdateTime(new java.sql.Timestamp(new java.util.Date().getTime()));
         testEntry.setWebsite(testWeblog);
-        testEntry.setCreator(testUser);
+        testEntry.setCreatorUserName(testUser.getUserName());
         
         WeblogCategory cat = mgr.getWeblogCategory(testWeblog.getDefaultCategory().getId());
         testEntry.setCategory(cat);
@@ -356,7 +356,7 @@
             testEntry.setUpdateTime(
                     new java.sql.Timestamp(new java.util.Date().getTime()));
             testEntry.setWebsite(testWeblog);
-            testEntry.setCreator(testUser);
+            testEntry.setCreatorUserName(testUser.getUserName());
             testEntry.setCategory(testWeblog.getDefaultCategory());
 
             // shortcut

Modified: roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/webservices/xmlrpc/RollerXmlRpcServerTest.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/webservices/xmlrpc/RollerXmlRpcServerTest.java?rev=581071&r1=581070&r2=581071&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/webservices/xmlrpc/RollerXmlRpcServerTest.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/test/java/org/apache/roller/weblogger/webservices/xmlrpc/RollerXmlRpcServerTest.java
Mon Oct  1 14:06:32 2007
@@ -172,7 +172,7 @@
             testEntry1.setPubTime(new Timestamp(new Date().getTime()));
             testEntry1.setUpdateTime(new Timestamp(new Date().getTime()));
             testEntry1.setWebsite(testWeblog);
-            testEntry1.setCreator(testUser);
+            testEntry1.setCreatorUserName(testUser.getUserName());
             testEntry1.setCategory(testWeblog.getDefaultCategory());
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry1);
 
@@ -184,7 +184,7 @@
             testEntry2.setPubTime(new Timestamp(new Date().getTime()));
             testEntry2.setUpdateTime(new Timestamp(new Date().getTime()));
             testEntry2.setWebsite(testWeblog);
-            testEntry2.setCreator(testUser);
+            testEntry2.setCreatorUserName(testUser.getUserName());
             testEntry2.setCategory(testWeblog.getDefaultCategory());
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry1);
 
@@ -196,7 +196,7 @@
             testEntry3.setPubTime(new Timestamp(new Date().getTime()));
             testEntry3.setUpdateTime(new Timestamp(new Date().getTime()));
             testEntry3.setWebsite(testWeblog);
-            testEntry3.setCreator(testUser);
+            testEntry3.setCreatorUserName(testUser.getUserName());
             testEntry3.setCategory(testWeblog.getDefaultCategory());           
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry1);
 



Mime
View raw message