roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1070260 - in /roller/trunk/weblogger-business/src/main: java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java resources/org/apache/roller/weblogger/pojos/WeblogBookmark.orm.xml
Date Sun, 13 Feb 2011 16:24:17 GMT
Author: snoopdave
Date: Sun Feb 13 16:24:16 2011
New Revision: 1070260

URL: http://svn.apache.org/viewvc?rev=1070260&view=rev
Log:
A couple of fixes necessary to make Roller better support Google Reader OPML file import.

Modified:
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
    roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/WeblogBookmark.orm.xml

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java?rev=1070260&r1=1070259&r2=1070260&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
Sun Feb 13 16:24:16 2011
@@ -248,6 +248,13 @@ public class JPABookmarkManagerImpl impl
         desc =    null!=desc ? desc : title;
         xmlUrl =  null!=xmlUrl ? xmlUrl : url;
         url =     null!=htmlUrl ? htmlUrl : url;
+        
+        // better to truncate imported OPML fields than to fail import or drop whole bookmark
+        // TODO: add way to notify user that fields were truncated
+        if (title != null   && title.length() > 254) title  = title.substring(0,
 254);
+        if (desc != null   && desc.length()   > 254)   desc   = desc.substring(0,
254);
+        if (url != null    && url.length()    > 254)    url    = url.substring(0,
254);
+        if (xmlUrl != null && xmlUrl.length() > 254) xmlUrl = xmlUrl.substring(0,
254);
 
         if (elem.getChildren().size()==0) {
             // Leaf element.  Store a bookmark

Modified: roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/WeblogBookmark.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/WeblogBookmark.orm.xml?rev=1070260&r1=1070259&r2=1070260&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/WeblogBookmark.orm.xml
(original)
+++ roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/WeblogBookmark.orm.xml
Sun Feb 13 16:24:16 2011
@@ -44,7 +44,7 @@
                 <column name="feedurl" insertable="true" updatable="true" unique="false"/>
             </basic>
             <many-to-one name="folder" target-entity="org.apache.roller.weblogger.pojos.WeblogBookmarkFolder">
-                <join-column name="folderid" insertable="true" updatable="true" nullable="false"/>
+                <join-column name="folderid" insertable="true" updatable="true" />
                 <cascade>
                     <cascade-persist />
                     <cascade-merge />



Mime
View raw message