roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1502823 [2/2] - in /roller/trunk/app/src: main/java/org/apache/roller/planet/pojos/ main/java/org/apache/roller/weblogger/business/ main/java/org/apache/roller/weblogger/business/jpa/ main/java/org/apache/roller/weblogger/pojos/ main/java/...
Date Sat, 13 Jul 2013 16:27:35 GMT
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java Sat Jul 13 16:27:34 2013
@@ -175,7 +175,7 @@ public class WeblogEntry implements Seri
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
+        buf.append(getId());
         buf.append(", ").append(this.getAnchor());
         buf.append(", ").append(this.getTitle());
         buf.append(", ").append(this.getPubTime());
@@ -781,7 +781,7 @@ public class WeblogEntry implements Seri
         if (!WebloggerRuntimeConfig.getBooleanProperty("users.comments.enabled")) {
             return false;
         }
-        if (website.getAllowComments() != null && !website.getAllowComments().booleanValue()) {
+        if (getWebsite().getAllowComments() != null && !getWebsite().getAllowComments().booleanValue()) {
             return false;
         }
         if (getAllowComments() != null && !getAllowComments().booleanValue()) {
@@ -926,7 +926,7 @@ public class WeblogEntry implements Seri
      * Returns absolute entry permalink.
      */
     public String getPermalink() {
-        return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogEntryURL(getWebsite(), null, anchor, true);
+        return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogEntryURL(getWebsite(), null, getAnchor(), true);
     }
     
     /**
@@ -937,7 +937,7 @@ public class WeblogEntry implements Seri
     public String getPermaLink() {
         String lAnchor = this.getAnchor();        
         try {
-            lAnchor = URLEncoder.encode(anchor, "UTF-8");
+            lAnchor = URLEncoder.encode(getAnchor(), "UTF-8");
         } catch (UnsupportedEncodingException e) {
             // go with the "no encoding" version
         }        
@@ -970,7 +970,7 @@ public class WeblogEntry implements Seri
      */
     public String getDisplayTitle() {
         if ( getTitle()==null || getTitle().trim().equals("") ) {
-            return StringUtils.left(Utilities.removeHTML(text),255);
+            return StringUtils.left(Utilities.removeHTML(getText()),255);
         }
         return Utilities.removeHTML(getTitle());
     }
@@ -990,7 +990,7 @@ public class WeblogEntry implements Seri
      * @roller.wrapPojoMethod type="simple"
      */
     public String getRss09xDescription(int maxLength) {
-        String ret = StringEscapeUtils.escapeHtml(text);
+        String ret = StringEscapeUtils.escapeHtml(getText());
         if (maxLength != -1 && ret.length() > maxLength) {
             ret = ret.substring(0,maxLength-3)+"...";
         }
@@ -1072,15 +1072,15 @@ public class WeblogEntry implements Seri
      * @return
      */
     public List getPluginsList() {
-        if (plugins != null) {
-            return Arrays.asList( StringUtils.split(plugins, ",") );
+        if (getPlugins() != null) {
+            return Arrays.asList( StringUtils.split(getPlugins(), ",") );
         }
         return new ArrayList();
     }    
     
     /** Convenience method for checking status */
     public boolean isDraft() {
-        return status.equals(DRAFT);
+        return getStatus().equals(DRAFT);
     }
     /** no-op: needed only to satisfy XDoclet, use setStatus() instead */
     public void setDraft(boolean value) {
@@ -1088,7 +1088,7 @@ public class WeblogEntry implements Seri
     
     /** Convenience method for checking status */
     public boolean isPending() {
-        return status.equals(PENDING);
+        return getStatus().equals(PENDING);
     }
     /** no-op: needed only to satisfy XDoclet, use setStatus() instead */
     public void setPending(boolean value) {
@@ -1096,7 +1096,7 @@ public class WeblogEntry implements Seri
     
     /** Convenience method for checking status */
     public boolean isPublished() {
-        return status.equals(PUBLISHED);
+        return getStatus().equals(PUBLISHED);
     }
     /** no-op: needed only to satisfy XDoclet, use setStatus() instead */
     public void setPublished(boolean value) {
@@ -1107,7 +1107,7 @@ public class WeblogEntry implements Seri
      * @roller.wrapPojoMethod type="simple"
      */
     public String getTransformedText() {
-        return render(text);
+        return render(getText());
     }
     /**
      * No-op to please XDoclet.
@@ -1121,7 +1121,7 @@ public class WeblogEntry implements Seri
      * @roller.wrapPojoMethod type="simple"
      */
     public String getTransformedSummary() {
-        return render(summary);
+        return render(getSummary());
     }
     /**
      * No-op to please XDoclet.
@@ -1171,7 +1171,7 @@ public class WeblogEntry implements Seri
     private String render(String str) {
         String ret = str;
         mLogger.debug("Applying page plugins to string");
-        Map plugins = this.website.getInitializedPlugins();
+        Map plugins = getWebsite().getInitializedPlugins();
         if (str != null && plugins != null) {
             List entryPlugins = getPluginsList();
             

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java Sat Jul 13 16:27:34 2013
@@ -79,9 +79,9 @@ public class WeblogEntryAttribute implem
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
-        buf.append(", ").append(this.name);
-        buf.append(", ").append(this.value);
+        buf.append(getId());
+        buf.append(", ").append(getName());
+        buf.append(", ").append(getValue());
         buf.append("}");
         return buf.toString();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java Sat Jul 13 16:27:34 2013
@@ -277,7 +277,7 @@ public class WeblogEntryComment implemen
      * Indicates that weblog owner considers this comment to be spam.
      */
     public Boolean getSpam() {
-        return new Boolean(SPAM.equals(this.status));
+        return new Boolean(SPAM.equals(getStatus()));
     }
     
     
@@ -285,7 +285,7 @@ public class WeblogEntryComment implemen
      * True if comment has is pending moderator approval.
      */
     public Boolean getPending() {
-        return new Boolean(PENDING.equals(this.status));
+        return new Boolean(PENDING.equals(getStatus()));
     }
     
     
@@ -293,7 +293,7 @@ public class WeblogEntryComment implemen
      * Indicates that comment has been approved for display on weblog.
      */
     public Boolean getApproved() {
-        return new Boolean(APPROVED.equals(this.status));
+        return new Boolean(APPROVED.equals(getStatus()));
     }
     
     
@@ -301,8 +301,8 @@ public class WeblogEntryComment implemen
      * Timestamp to be used to formulate comment permlink.
      */
     public String getTimestamp() {
-        if (postTime != null) {
-            return Long.toString(postTime.getTime());
+        if (getPostTime() != null) {
+            return Long.toString(getPostTime().getTime());
         }
         return null;
     }
@@ -312,10 +312,10 @@ public class WeblogEntryComment implemen
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
-        buf.append(", ").append(this.name);
-        buf.append(", ").append(this.email);
-        buf.append(", ").append(this.postTime);
+        buf.append(getId());
+        buf.append(", ").append(getName());
+        buf.append(", ").append(getEmail());
+        buf.append(", ").append(getPostTime());
         buf.append("}");
         return buf.toString();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java Sat Jul 13 16:27:34 2013
@@ -140,9 +140,9 @@ public class WeblogEntryTag implements S
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
-        buf.append(", ").append(this.name);
-        buf.append(", ").append(this.time);
+        buf.append(getId());
+        buf.append(", ").append(getName());
+        buf.append(", ").append(getTime());
         buf.append("}");
         return buf.toString();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java Sat Jul 13 16:27:34 2013
@@ -108,10 +108,10 @@ public class WeblogEntryTagAggregate imp
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
-        buf.append(", ").append(this.name);
-        buf.append(", ").append(this.total);
-        buf.append(", ").append(this.lastUsed);
+        buf.append(getId());
+        buf.append(", ").append(getName());
+        buf.append(", ").append(getTotal());
+        buf.append(", ").append(getLastUsed());
         buf.append("}");
         return buf.toString();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java Sat Jul 13 16:27:34 2013
@@ -41,8 +41,8 @@ public class WeblogHitCount implements S
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
-        buf.append(", ").append(this.dailyHits);
+        buf.append(getId());
+        buf.append(", ").append(getDailyHits());
         buf.append("}");
         return buf.toString();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java Sat Jul 13 16:27:34 2013
@@ -148,10 +148,10 @@ public class WeblogReferrer implements S
     }
     
     public void setRefererUrl(String refererUrl) {
-        this.refererUrl = refererUrl;
-        if (this.refererUrl != null && this.refererUrl.length() > 255) {
-            this.refererUrl = this.refererUrl.substring(0, 255);
+        if (refererUrl != null && refererUrl.length() > 255) {
+            refererUrl = refererUrl.substring(0, 255);
         }
+        this.refererUrl = refererUrl;
     }
     
     /**
@@ -345,11 +345,11 @@ public class WeblogReferrer implements S
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
-        buf.append(", ").append(this.requestUrl);
-        buf.append(", ").append(this.refererUrl);
-        buf.append(", ").append(this.dayHits);
-        buf.append(", ").append(this.totalHits);
+        buf.append(getId());
+        buf.append(", ").append(getRequestUrl());
+        buf.append(", ").append(getRefererUrl());
+        buf.append(", ").append(getDayHits());
+        buf.append(", ").append(getTotalHits());
         buf.append("}");
         return buf.toString();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java Sat Jul 13 16:27:34 2013
@@ -75,12 +75,12 @@ public class WeblogTemplate implements T
     
     
     public ThemeTemplate getDecorator() {
-        if(decoratorName != null && !id.equals(decoratorName)) {
+        if(getDecoratorName() != null && !getId().equals(getDecoratorName())) {
             try {
-                return weblog.getTheme().getTemplateByName(decoratorName);
+                return weblog.getTheme().getTemplateByName(getDecoratorName());
             } catch (WebloggerException ex) {
-                log.error("Error getting decorator["+decoratorName+"] "+
-                        "for template "+id);
+                log.error("Error getting decorator["+getDecoratorName()+"] "+
+                        "for template "+getId());
             }
         }
         return null;
@@ -221,7 +221,7 @@ public class WeblogTemplate implements T
         * eventually, the required flag should probably be stored in the db
         * and possibly applicable to any template.
         */
-        return (requiredTemplates.contains(this.name) || "Weblog".equals(this.link));
+        return (requiredTemplates.contains(getName()) || "Weblog".equals(getLink()));
     }
     
     
@@ -234,7 +234,7 @@ public class WeblogTemplate implements T
     }
 
     public WeblogThemeTemplateCode getTemplateCode(String type) throws WebloggerException {
-        return WebloggerFactory.getWeblogger().getWeblogManager().getTemplateCodeByType(this.id, type);
+        return WebloggerFactory.getWeblogger().getWeblogManager().getTemplateCodeByType(getId(), type);
     }
 
       public String getType() {
@@ -251,11 +251,11 @@ public class WeblogTemplate implements T
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
-        buf.append(", ").append(this.name);
-        buf.append(", ").append(this.link);
-        buf.append(", ").append(this.decoratorName);
-        buf.append(", ").append(this.templateLanguage);
+        buf.append(getId());
+        buf.append(", ").append(getName());
+        buf.append(", ").append(getLink());
+        buf.append(", ").append(getDecoratorName());
+        buf.append(", ").append(getTemplateLanguage());
         buf.append("}");
         return buf.toString();
     }
@@ -265,7 +265,7 @@ public class WeblogTemplate implements T
         if (other instanceof WeblogTemplate != true) return false;
         WeblogTemplate o = (WeblogTemplate)other;
         return new EqualsBuilder()
-            .append(name, o.getName()) 
+            .append(getName(), o.getName())
             .append(getWebsite(), o.getWebsite()) 
             .isEquals();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java Sat Jul 13 16:27:34 2013
@@ -112,7 +112,7 @@ public class WeblogThemeAssoc implements
      public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
-        buf.append(this.id);
+        buf.append(getId());
         buf.append("}");
         return buf.toString();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeTemplateCode.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeTemplateCode.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeTemplateCode.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeTemplateCode.java Sat Jul 13 16:27:34 2013
@@ -111,10 +111,10 @@ public class WeblogThemeTemplateCode imp
 	public String toString() {
 		StringBuffer buf = new StringBuffer();
 		buf.append("{");
-		buf.append(this.id);
-		buf.append(", ").append(this.templateId);
-		buf.append(", [ ").append(this.template);
-		buf.append("] , ").append(this.type);
+		buf.append(getId());
+		buf.append(", ").append(getTemplateId());
+		buf.append(", [ ").append(getTemplate());
+		buf.append("] , ").append(getType());
 		buf.append("}");
 		return buf.toString();
 	}
@@ -125,8 +125,8 @@ public class WeblogThemeTemplateCode imp
 		if (other instanceof WeblogThemeTemplateCode != true)
 			return false;
 		WeblogThemeTemplateCode o = (WeblogThemeTemplateCode) other;
-		return new EqualsBuilder().append(templateId, o.getTemplateId())
-				.append(template, o.getTemplate()).isEquals();
+		return new EqualsBuilder().append(getTemplateId(), o.getTemplateId())
+				.append(getTemplate(), o.getTemplate()).isEquals();
 	}
 
 	public int hashCode() {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java Sat Jul 13 16:27:34 2013
@@ -17,34 +17,29 @@
  */
 package org.apache.roller.weblogger.ui.struts2.editor;
 
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.lang.StringUtils;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.pojos.MediaFile;
-import org.apache.roller.weblogger.pojos.MediaFileTag;
 
 /**
  * Bean for managing media file.
  */
 public class MediaFileBean {
 
-    private String  id;
-    private String  name;
-    private String  description;
-    private String  contentType;
-    private String  copyrightText;
-    private String  tags;
-    private String  directoryId;
+    private String id;
+    private String name;
+    private String description;
+    private String contentType;
+    private String copyrightText;
+    private String tagsAsString;
+    private String directoryId;
     private boolean isSharedForGallery;
-    private String  permalink;
-    private String  thumbnailURL;
+    private String permalink;
+    private String thumbnailURL;
     private boolean isImage;
-    private int     width;
-    private int     height;
-    private long    length;
-    private String  originalPath;
+    private int width;
+    private int height;
+    private long length;
+    private String originalPath;
 
     public String getName() {
         return name;
@@ -70,12 +65,12 @@ public class MediaFileBean {
         this.copyrightText = copyrightText;
     }
 
-    public String getTags() {
-        return tags;
+    public String getTagsAsString() {
+        return this.tagsAsString;
     }
 
-    public void setTags(String tags) {
-        this.tags = tags;
+    public void setTagsAsString(String tagsAsString) {
+        this.tagsAsString = tagsAsString;
     }
 
     public String getDirectoryId() {
@@ -111,22 +106,13 @@ public class MediaFileBean {
         dataHolder.setName(this.name);
         dataHolder.setDescription(this.description);
         dataHolder.setCopyrightText(this.copyrightText);
-
-		if (StringUtils.isNotEmpty(tags)) {
-			Set<MediaFileTag> tagsSet = new HashSet<MediaFileTag>();
-			for (String tag : this.tags.split(" ")) {
-				tagsSet.add(new MediaFileTag(tag, dataHolder));
-			}
-			dataHolder.setTags(tagsSet);
-		} else {
-			dataHolder.setTags(null);
-		}
+        dataHolder.setTagsAsString(this.tagsAsString);
         dataHolder.setSharedForGallery(this.isSharedForGallery);
         dataHolder.setOriginalPath(this.originalPath);
     }
 
     /**
-     * Populates this bean from a media file object. 
+     * Populates this bean from a media file object.
      * 
      */
     public void copyFrom(MediaFile dataHolder) {
@@ -134,22 +120,7 @@ public class MediaFileBean {
         this.setName(dataHolder.getName());
         this.setDescription(dataHolder.getDescription());
         this.setCopyrightText(dataHolder.getCopyrightText());
-
-        Set<MediaFileTag> tags = dataHolder.getTags();
-        if (tags != null && !tags.isEmpty()) {
-            StringBuilder tagDisplayBuilder = new StringBuilder();
-            for (MediaFileTag tag : dataHolder.getTags()) {
-            	if (StringUtils.isNotEmpty(tag.getName())) {
-            		tagDisplayBuilder.append(tag.getName());
-                    tagDisplayBuilder.append(" ");
-				}
-            }
-			if (tagDisplayBuilder.length() > 0) {
-				tagDisplayBuilder.deleteCharAt(tagDisplayBuilder.length() - 1);
-			}
-            this.setTags(tagDisplayBuilder.toString());
-        }
-
+        this.setTagsAsString(dataHolder.getTagsAsString());
         this.setSharedForGallery(dataHolder.isSharedForGallery());
         this.setDirectoryId(dataHolder.getDirectory().getId());
         this.setPermalink(dataHolder.getPermalink());
@@ -170,7 +141,8 @@ public class MediaFileBean {
     }
 
     /**
-     * @param permalink the permalink to set
+     * @param permalink
+     *            the permalink to set
      */
     public void setPermalink(String permalink) {
         this.permalink = permalink;
@@ -184,7 +156,8 @@ public class MediaFileBean {
     }
 
     /**
-     * @param isImage the isImage to set
+     * @param isImage
+     *            the isImage to set
      */
     public void setIsImage(boolean isImage) {
         this.isImage = isImage;
@@ -198,7 +171,8 @@ public class MediaFileBean {
     }
 
     /**
-     * @param thumbnailURL the thumbnailURL to set
+     * @param thumbnailURL
+     *            the thumbnailURL to set
      */
     public void setThumbnailURL(String thumbnailURL) {
         this.thumbnailURL = thumbnailURL;
@@ -212,7 +186,8 @@ public class MediaFileBean {
     }
 
     /**
-     * @param width the width to set
+     * @param width
+     *            the width to set
      */
     public void setWidth(int width) {
         this.width = width;
@@ -226,7 +201,8 @@ public class MediaFileBean {
     }
 
     /**
-     * @param height the height to set
+     * @param height
+     *            the height to set
      */
     public void setHeight(int height) {
         this.height = height;
@@ -240,7 +216,8 @@ public class MediaFileBean {
     }
 
     /**
-     * @param length the length to set
+     * @param length
+     *            the length to set
      */
     public void setLength(long length) {
         this.length = length;
@@ -254,7 +231,8 @@ public class MediaFileBean {
     }
 
     /**
-     * @param contentType the contentType to set
+     * @param contentType
+     *            the contentType to set
      */
     public void setContentType(String contentType) {
         this.contentType = contentType;
@@ -268,7 +246,8 @@ public class MediaFileBean {
     }
 
     /**
-     * @param originalPath the originalPath to set
+     * @param originalPath
+     *            the originalPath to set
      */
     public void setOriginalPath(String originalPath) {
         this.originalPath = originalPath;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java Sat Jul 13 16:27:34 2013
@@ -344,7 +344,9 @@ public class MailUtil {
         }
         
         if (!StringUtils.isEmpty(commentObject.getName())) {
-            msg.append(commentObject.getName() + " "
+            String emailAddress = StringUtils.isBlank(commentObject.getEmail()) ? " " :
+                    " (" + commentObject.getEmail() + ") ";
+            msg.append(commentObject.getName() + emailAddress
                     + resources.getString("email.comment.wrote")+": ");
         } else {
             msg.append(resources.getString("email.comment.anonymous")+": ");

Modified: roller/trunk/app/src/main/resources/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources.properties?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources.properties Sat Jul 13 16:27:34 2013
@@ -2104,7 +2104,7 @@ weblogEdit.hasComments=<a href="{0}">Com
 weblogEdit.enclosureURL=Enclosure URL
 weblogEdit.enclosureType=Type
 weblogEdit.enclosureLength=Length
-weblogEdit.encosureInvalid=Enclosure URL is invalid
+weblogEdit.enclosureInvalid=Enclosure URL is invalid
 weblogEdit.mediaCastFailedFetchingInfo=Unable to reach the enclosure. Check the hostname in the URL.
 weblogEdit.mediaCastUrlMalformed=The enclosure URL was malformed.
 weblogEdit.mediaCastResponseError=The enclosure server returned an error. Do you have the right URL?

Modified: roller/trunk/app/src/main/resources/ApplicationResources_de.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_de.properties?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_de.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_de.properties Sat Jul 13 16:27:34 2013
@@ -1169,7 +1169,7 @@ weblogEdit.edit=Bearbeiten
 weblogEdit.enclosureLength=L\u00E4nge
 weblogEdit.enclosureType=Typ
 weblogEdit.enclosureURL=Enclosure URL
-weblogEdit.encosureInvalid=Enclosure URL ist ung\u00FCltig
+weblogEdit.enclosureInvalid=Enclosure URL ist ung\u00FCltig
 weblogEdit.entryCol=Weblogeintr\u00E4ge
 weblogEdit.entryRemoved=Eintrag gel\u00F6scht
 weblogEdit.entrySaved=Eintrag gesichert

Modified: roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties Sat Jul 13 16:27:34 2013
@@ -1403,8 +1403,8 @@ weblogEdit.hasComments=Comments [{0}]
 
 weblogEdit.enclosureURL=Enclosure URL
 weblogEdit.enclosureType=Type
-weblogEdit.encosureLegnth=Length
-weblogEdit.encosureInvalid=Enclosure URL\u306F\u7121\u52B9\u3067\u3059
+weblogEdit.enclosureLength=Length
+weblogEdit.enclosureInvalid=Enclosure URL\u306F\u7121\u52B9\u3067\u3059
 weblogEdit.mediaCastFailedFetchingInfo=Unable to reach the enclosure. Check the hostname in the URL.
 weblogEdit.mediaCastUrlMalformed=The enclosure URL was malformed.
 weblogEdit.mediaCastResponseError=The enclosure server returned an error. Do you have the right URL?

Modified: roller/trunk/app/src/main/resources/ApplicationResources_sl.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_sl.properties?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_sl.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_sl.properties Sat Jul 13 16:27:34 2013
@@ -1758,8 +1758,8 @@ weblogEdit.hasComments=<a href="{0}">Kom
 
 weblogEdit.enclosureURL=Vklju\u010Deni URL
 weblogEdit.enclosureType=Tip
-weblogEdit.encosureLegnth=Dol\u017Eina
-weblogEdit.encosureInvalid=Vklju\u010Deni URL je nepravilen
+weblogEdit.enclosureLength=Dol\u017Eina
+weblogEdit.enclosureInvalid=Vklju\u010Deni URL je nepravilen
 weblogEdit.mediaCastFailedFetchingInfo=Ni mogop\u010De dose\u010Di vklju\u010Denega. Preverite ime stre\u017Enika v  URL.
 weblogEdit.mediaCastUrlMalformed=Vklju\u010Deni URL je bil nepravilen.
 weblogEdit.mediaCastResponseError=Vklju\u010Deni stre\u017Enik je vrnil napako. Imate pravi URL naslov?

Modified: roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties (original)
+++ roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties Sat Jul 13 16:27:34 2013
@@ -687,10 +687,6 @@ log4j.logger.com.ecyrd.jspwiki=ERROR
 log4j.logger.com.opensymphony.oscache=ERROR
 log4j.logger.com.danga.MemCached=ERROR
 
-# Ask OpenJPA to log to Log4J via Apache Commons Logging
-openjpa.Log=commons
-log4j.logger.openjpa=ERROR
-
 #-----------------------------------------------------------------------------
 # Other settings
 #-----------------------------------------------------------------------------

Modified: roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml (original)
+++ roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml Sat Jul 13 16:27:34 2013
@@ -61,7 +61,7 @@
             <many-to-one name="weblog" target-entity="org.apache.roller.weblogger.pojos.Weblog">
                 <join-column name="weblogid" insertable="true" updatable="true" nullable="false"/>
             </many-to-one>
-            <one-to-many name="tags" mapped-by="mediaFile" target-entity="org.apache.roller.weblogger.pojos.MediaFileTag">
+            <one-to-many name="tags" mapped-by="mediaFile" target-entity="org.apache.roller.weblogger.pojos.MediaFileTag" fetch="LAZY">
                 <cascade>
                     <cascade-persist /> <!-- Added so entry added by addTag() gets persisted -->
                     <cascade-remove />
@@ -73,6 +73,7 @@
             <transient name="path"/>
             <transient name="creator"/>
             <transient name="imageFile"/>
+            <transient name="tagsAsString"/>
             <transient name="inputStream"/>
             <transient name="thumbnailInputStream"/>
             <transient name="thumbnailHeight"/>

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java?rev=1502823&r1=1502822&r2=1502823&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java (original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java Sat Jul 13 16:27:34 2013
@@ -256,9 +256,9 @@ public class MediaFileTest extends TestC
     }
 
     /**
-     * Test utility to determine whether the given list of directories 
+     * Test utility to determine whether the given list of directories
      * contains a directory of given path.
-     * 
+     *
      */
     private boolean containsPath(Collection<MediaFileDirectory> directories, String path) {
         for (MediaFileDirectory directory : directories) {
@@ -272,7 +272,7 @@ public class MediaFileTest extends TestC
 
     /**
      * Test utility to determine whether the list of files contains a file with given name.
-     * 
+     *
      */
     private boolean containsFileWithName(Collection<MediaFile> files, String name) {
         for (MediaFile file : files) {
@@ -317,12 +317,8 @@ public class MediaFileTest extends TestC
         mediaFile.setContentType("image/jpeg");
         mediaFile.setInputStream(getClass().getResourceAsStream(TEST_IMAGE));
 
-        MediaFileTag tag1 = new MediaFileTag("tst4work", mediaFile);
-        MediaFileTag tag2 = new MediaFileTag("tst4home", mediaFile);
-        Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
-        tags.add(tag1);
-        tags.add(tag2);
-        mediaFile.setTags(tags);
+        // Add tags
+        mediaFile.setTagsAsString("tst4work tst4home");
 
         mfMgr.createMediaFile(testWeblog, mediaFile, new RollerMessages());
         String id = mediaFile.getId();
@@ -392,12 +388,8 @@ public class MediaFileTest extends TestC
         mediaFile.setContentType("image/jpeg");
         rootDirectory.getMediaFiles().add(mediaFile);
 
-        MediaFileTag tag1 = new MediaFileTag("work", mediaFile);
-        MediaFileTag tag2 = new MediaFileTag("home", mediaFile);
-        Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
-        tags.add(tag1);
-        tags.add(tag2);
-        mediaFile.setTags(tags);
+        // Add tags
+        mediaFile.setTagsAsString("work home");
 
         mfMgr.createMediaFile(testWeblog, mediaFile, new RollerMessages());
         TestUtils.endSession(true);
@@ -432,103 +424,97 @@ public class MediaFileTest extends TestC
         MediaFileDirectory rootDirectory = mfMgr.getMediaFileRootDirectory(testWeblog);
 
         try {
-        	
-	        String id1 = null;
-	        {
-	            MediaFile mf = new MediaFile();
-	            mf.setName("test_work.jpg");
-	            mf.setDescription("This is a test image");
-	            mf.setCopyrightText("test copyright text");
-	            mf.setSharedForGallery(true);
-	            mf.setLength(2000);
-	            mf.setDirectory(rootDirectory);
-	            mf.setWeblog(testWeblog);
-	            mf.setInputStream(getClass().getResourceAsStream(TEST_IMAGE));
-	            mf.setContentType("image/jpeg");
-	            rootDirectory.getMediaFiles().add(mf);
-	
-	            mfMgr.createMediaFile(testWeblog, mf, new RollerMessages());
-
-	            MediaFileTag tag = new MediaFileTag("work", mf);
-	            Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
-	            tags.add(tag);
-	            mf.setTags(tags);
-	            mfMgr.updateMediaFile(testWeblog, mf);
-	            
-	            mfMgr.createMediaFile(testWeblog, mf, new RollerMessages());
-	            TestUtils.endSession(true);
-	            id1 = mf.getId();
-	            assertNotNull(mf.getId());
-	            assertNotNull(mf.getId().length() > 0);
-	        }
-	
-	        String id2 = null;
-	        {
-	            testWeblog = TestUtils.getManagedWebsite(testWeblog);
-	            rootDirectory = mfMgr.getMediaFileDirectory(rootDirectory.getId());
-	            
-	            MediaFile mf = new MediaFile();
-	            mf = new MediaFile();
-	            mf.setName("test_home.jpg");
-	            mf.setDescription("This is a test image");
-	            mf.setCopyrightText("test copyright text");
-	            mf.setSharedForGallery(true);
-	            mf.setLength(3000);
-	            mf.setDirectory(rootDirectory);
-	            mf.setWeblog(testWeblog);
-	            mf.setInputStream(getClass().getResourceAsStream(TEST_IMAGE));
-	            mf.setContentType("image/jpeg");
-	            rootDirectory.getMediaFiles().add(mf);
-	
-	            mfMgr.createMediaFile(testWeblog, mf, new RollerMessages());
-
-	            MediaFileTag tag = new MediaFileTag("home", mf);
-	            Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
-	            tags.add(tag);
-	            mf.setTags(tags);
-	            mfMgr.updateMediaFile(testWeblog, mf);
-	
-	            TestUtils.endSession(true);
-	            id2 = mf.getId();
-	            assertNotNull(mf.getId());
-	            assertNotNull(mf.getId().length() > 0);
-	        }
-	
-	        String id3 = null;
-	        {
-	            testWeblog = TestUtils.getManagedWebsite(testWeblog);
-	            rootDirectory = mfMgr.getMediaFileDirectory(rootDirectory.getId());
-	
-	            MediaFile mf = new MediaFile();
-	            mf = new MediaFile();
-	            mf.setName("test_pers.jpg");
-	            mf.setDescription("This is a personal test image");
-	            mf.setCopyrightText("test pers copyright text");
-	            mf.setSharedForGallery(true);
-	            mf.setLength(4000);
-	            mf.setWeblog(testWeblog);
-	            mf.setDirectory(rootDirectory);
-	            mf.setInputStream(getClass().getResourceAsStream(TEST_IMAGE));
-	            mf.setContentType("image/jpeg");
-	            rootDirectory.getMediaFiles().add(mf);
-	
-	            mfMgr.createMediaFile(testWeblog, mf, new RollerMessages());
-
-	            MediaFileTag tag = new MediaFileTag("home", mf);
-	            Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
-	            tags.add(tag);
-	            mf.setTags(tags);
-	            mfMgr.updateMediaFile(testWeblog, mf);
-	
-	            TestUtils.endSession(true);
-	            id3 = mf.getId();
-	            assertNotNull(mf.getId());
-	            assertNotNull(mf.getId().length() > 0);
-	        }
-	
-	        testWeblog = TestUtils.getManagedWebsite(testWeblog);
-	
-	        List<MediaFile> searchResults;
+
+            String id1 = null;
+            {
+                MediaFile mf = new MediaFile();
+                mf.setName("test_work.jpg");
+                mf.setDescription("This is a test image");
+                mf.setCopyrightText("test copyright text");
+                mf.setSharedForGallery(true);
+                mf.setLength(2000);
+                mf.setDirectory(rootDirectory);
+                mf.setWeblog(testWeblog);
+                mf.setInputStream(getClass().getResourceAsStream(TEST_IMAGE));
+                mf.setContentType("image/jpeg");
+                rootDirectory.getMediaFiles().add(mf);
+
+                mfMgr.createMediaFile(testWeblog, mf, new RollerMessages());
+
+                // Add tags
+                mf.setTagsAsString("work");
+                mfMgr.updateMediaFile(testWeblog, mf);
+
+                mfMgr.createMediaFile(testWeblog, mf, new RollerMessages());
+                TestUtils.endSession(true);
+                id1 = mf.getId();
+                assertNotNull(mf.getId());
+                assertNotNull(mf.getId().length() > 0);
+            }
+
+            String id2 = null;
+            {
+                testWeblog = TestUtils.getManagedWebsite(testWeblog);
+                rootDirectory = mfMgr.getMediaFileDirectory(rootDirectory.getId());
+
+                MediaFile mf = new MediaFile();
+                mf = new MediaFile();
+                mf.setName("test_home.jpg");
+                mf.setDescription("This is a test image");
+                mf.setCopyrightText("test copyright text");
+                mf.setSharedForGallery(true);
+                mf.setLength(3000);
+                mf.setDirectory(rootDirectory);
+                mf.setWeblog(testWeblog);
+                mf.setInputStream(getClass().getResourceAsStream(TEST_IMAGE));
+                mf.setContentType("image/jpeg");
+                rootDirectory.getMediaFiles().add(mf);
+
+                mfMgr.createMediaFile(testWeblog, mf, new RollerMessages());
+
+                // Add tags
+                mf.setTagsAsString("home");
+                mfMgr.updateMediaFile(testWeblog, mf);
+
+                TestUtils.endSession(true);
+                id2 = mf.getId();
+                assertNotNull(mf.getId());
+                assertNotNull(mf.getId().length() > 0);
+            }
+
+            String id3 = null;
+            {
+                testWeblog = TestUtils.getManagedWebsite(testWeblog);
+                rootDirectory = mfMgr.getMediaFileDirectory(rootDirectory.getId());
+
+                MediaFile mf = new MediaFile();
+                mf = new MediaFile();
+                mf.setName("test_pers.jpg");
+                mf.setDescription("This is a personal test image");
+                mf.setCopyrightText("test pers copyright text");
+                mf.setSharedForGallery(true);
+                mf.setLength(4000);
+                mf.setWeblog(testWeblog);
+                mf.setDirectory(rootDirectory);
+                mf.setInputStream(getClass().getResourceAsStream(TEST_IMAGE));
+                mf.setContentType("image/jpeg");
+                rootDirectory.getMediaFiles().add(mf);
+
+                mfMgr.createMediaFile(testWeblog, mf, new RollerMessages());
+
+                // Add tags
+                mf.setTagsAsString("home");
+                mfMgr.updateMediaFile(testWeblog, mf);
+
+                TestUtils.endSession(true);
+                id3 = mf.getId();
+                assertNotNull(mf.getId());
+                assertNotNull(mf.getId().length() > 0);
+            }
+
+            testWeblog = TestUtils.getManagedWebsite(testWeblog);
+
+            List<MediaFile> searchResults;
 
             // search by name
 
@@ -646,18 +632,18 @@ public class MediaFileTest extends TestC
         Weblog testWeblog = null;
         testUser = TestUtils.setupUser("mediaFileTestUser9");
         testWeblog = TestUtils.setupWeblog("mediaFileTestWeblog9", testUser);
-   
+
         try {
-	        MediaFileManager mfMgr = WebloggerFactory.getWeblogger().getMediaFileManager();
-	
-	        // no need to create root directory, that is done automatically now
-	        MediaFileDirectory rootDirectory = mfMgr.getMediaFileRootDirectory(testWeblog);
-	
-	        //MediaFileDirectory rootDirectory = new MediaFileDirectory(null, "root", "root d", testWeblog);
-	        //mfMgr.createMediaFileDirectory(rootDirectory);
-	        //TestUtils.endSession(true);
-	
-	        for (int i = 0; i < 15; i++) {
+            MediaFileManager mfMgr = WebloggerFactory.getWeblogger().getMediaFileManager();
+
+            // no need to create root directory, that is done automatically now
+            MediaFileDirectory rootDirectory = mfMgr.getMediaFileRootDirectory(testWeblog);
+
+            //MediaFileDirectory rootDirectory = new MediaFileDirectory(null, "root", "root d", testWeblog);
+            //mfMgr.createMediaFileDirectory(rootDirectory);
+            //TestUtils.endSession(true);
+
+            for (int i = 0; i < 15; i++) {
                 rootDirectory = mfMgr.getMediaFileDirectory(rootDirectory.getId());
                 testWeblog = TestUtils.getManagedWebsite(testWeblog);
                 MediaFile mediaFile = new MediaFile();
@@ -669,56 +655,56 @@ public class MediaFileTest extends TestC
                 mediaFile.setWeblog(testWeblog);
                 mediaFile.setInputStream(getClass().getResourceAsStream(TEST_IMAGE));
                 mediaFile.setContentType("image/jpeg");
-                mediaFile.setDirectory(rootDirectory);
                 mfMgr.createMediaFile(testWeblog, mediaFile, new RollerMessages());
                 rootDirectory.getMediaFiles().add(mediaFile);
+                mediaFile.setDirectory(rootDirectory);
                 assertNotNull(mediaFile.getId());
                 assertNotNull(mediaFile.getId().length() > 0);
                 TestUtils.endSession(true);
-	        }
-	        
-	        testWeblog = TestUtils.getManagedWebsite(testWeblog);
-	        MediaFileFilter filter1 = new MediaFileFilter();
-	        filter1.setSize(1000);
-	        filter1.setSizeFilterType(SizeFilterType.GT);
-	        List<MediaFile> searchResults1 = mfMgr.searchMediaFiles(testWeblog, filter1);
-	        assertFalse(searchResults1.isEmpty());
-	        assertEquals(15, searchResults1.size());
-	
-	        MediaFileFilter filter2 = new MediaFileFilter();
-	        filter2.setSize(1000);
-	        filter2.setSizeFilterType(SizeFilterType.GT);
-	        filter2.setStartIndex(5);
-	        filter2.setLength(3);
-	        List<MediaFile> searchResults2 = mfMgr.searchMediaFiles(testWeblog, filter2);
-	        assertFalse(searchResults2.isEmpty());
-	        assertEquals(3, searchResults2.size());
-	        assertEquals("test_file13.jpg", searchResults2.get(0).getName());
-	
-	        MediaFileFilter filter3 = new MediaFileFilter();
-	        filter3.setSize(1000);
-	        filter3.setSizeFilterType(SizeFilterType.GT);
-	        filter3.setStartIndex(13);
-	        filter3.setLength(6);
-	        List<MediaFile> searchResults3 = mfMgr.searchMediaFiles(testWeblog, filter3);
-	        assertFalse(searchResults3.isEmpty());
-	        assertEquals(2, searchResults3.size());
-	        assertEquals("test_file8.jpg", searchResults3.get(0).getName());
-	
-	        MediaFileFilter filter4 = new MediaFileFilter();
-	        filter4.setSize(1000);
-	        filter4.setSizeFilterType(SizeFilterType.GT);
-	        filter4.setStartIndex(14);
-	        filter4.setLength(1);
-	        List<MediaFile> searchResults4 = mfMgr.searchMediaFiles(testWeblog, filter4);
-	        assertFalse(searchResults4.isEmpty());
-	        assertEquals(1, searchResults4.size());
-	        assertEquals("test_file9.jpg", searchResults4.get(0).getName());
-	
-	        TestUtils.endSession(true);
+            }
+
+            testWeblog = TestUtils.getManagedWebsite(testWeblog);
+            MediaFileFilter filter1 = new MediaFileFilter();
+            filter1.setSize(1000);
+            filter1.setSizeFilterType(SizeFilterType.GT);
+            List<MediaFile> searchResults1 = mfMgr.searchMediaFiles(testWeblog, filter1);
+            assertFalse(searchResults1.isEmpty());
+            assertEquals(15, searchResults1.size());
+
+            MediaFileFilter filter2 = new MediaFileFilter();
+            filter2.setSize(1000);
+            filter2.setSizeFilterType(SizeFilterType.GT);
+            filter2.setStartIndex(5);
+            filter2.setLength(3);
+            List<MediaFile> searchResults2 = mfMgr.searchMediaFiles(testWeblog, filter2);
+            assertFalse(searchResults2.isEmpty());
+            assertEquals(3, searchResults2.size());
+            assertEquals("test_file13.jpg", searchResults2.get(0).getName());
+
+            MediaFileFilter filter3 = new MediaFileFilter();
+            filter3.setSize(1000);
+            filter3.setSizeFilterType(SizeFilterType.GT);
+            filter3.setStartIndex(13);
+            filter3.setLength(6);
+            List<MediaFile> searchResults3 = mfMgr.searchMediaFiles(testWeblog, filter3);
+            assertFalse(searchResults3.isEmpty());
+            assertEquals(2, searchResults3.size());
+            assertEquals("test_file8.jpg", searchResults3.get(0).getName());
+
+            MediaFileFilter filter4 = new MediaFileFilter();
+            filter4.setSize(1000);
+            filter4.setSizeFilterType(SizeFilterType.GT);
+            filter4.setStartIndex(14);
+            filter4.setLength(1);
+            List<MediaFile> searchResults4 = mfMgr.searchMediaFiles(testWeblog, filter4);
+            assertFalse(searchResults4.isEmpty());
+            assertEquals(1, searchResults4.size());
+            assertEquals("test_file9.jpg", searchResults4.get(0).getName());
+
+            TestUtils.endSession(true);
         } finally {
-        	TestUtils.teardownWeblog(testWeblog.getId());
-        	TestUtils.teardownUser(testUser.getUserName());
+            TestUtils.teardownWeblog(testWeblog.getId());
+            TestUtils.teardownUser(testUser.getUserName());
         }
     }
 
@@ -835,12 +821,8 @@ public class MediaFileTest extends TestC
         mediaFile.setContentType("image/jpeg");
         rootDirectory.getMediaFiles().add(mediaFile);
 
-        MediaFileTag tag1 = new MediaFileTag("tst5work", mediaFile);
-        MediaFileTag tag2 = new MediaFileTag("tst5home", mediaFile);
-        Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
-        tags.add(tag1);
-        tags.add(tag2);
-        mediaFile.setTags(tags);
+        // Add tags
+        mediaFile.setTagsAsString("tst5work tst5home");
 
         mfMgr.createMediaFile(testWeblog, mediaFile, new RollerMessages());
         String id = mediaFile.getId();
@@ -1040,7 +1022,7 @@ public class MediaFileTest extends TestC
 
             mediaFiles = rootDirectory.getMediaFiles();
             assertEquals(0, mediaFiles.size());
-            
+
         } finally {
             TestUtils.endSession(true);
             TestUtils.teardownWeblog(testWeblog.getId());
@@ -1094,8 +1076,8 @@ public class MediaFileTest extends TestC
 
         } finally {
 
-            File statusFile = new File(WebloggerConfig.getProperty("uploads.dir") 
-                + File.separator + JPAMediaFileManagerImpl.MIGRATION_STATUS_FILENAME);
+            File statusFile = new File(WebloggerConfig.getProperty("uploads.dir")
+                    + File.separator + JPAMediaFileManagerImpl.MIGRATION_STATUS_FILENAME);
             statusFile.delete();
 
             // reset dir max to old value
@@ -1110,4 +1092,4 @@ public class MediaFileTest extends TestC
             TestUtils.endSession(true);
         }
     }
-}
+}
\ No newline at end of file



Mime
View raw message