roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ganes...@apache.org
Subject svn commit: r772831 - in /roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger: business/ pojos/ ui/rendering/servlets/ ui/struts2/editor/ ui/struts2/pagers/
Date Fri, 08 May 2009 03:10:25 GMT
Author: ganeshmb
Date: Fri May  8 03:10:24 2009
New Revision: 772831

URL: http://svn.apache.org/viewvc?rev=772831&view=rev
Log:
code cleanup, documentation added.

Modified:
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManager.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManager.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/FileContent.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileComparator.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectory.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectoryComparator.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileFilter.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileTag.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileType.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageDim.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearch.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearchBean.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/pagers/MediaFilePager.java

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManager.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManager.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManager.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManager.java Fri May  8 03:10:24 2009
@@ -37,8 +37,7 @@
      * if the specificed path doesn't exist, or can't be read.
      * 
      * @param weblog The weblog we are working on.
-     * @param path The relative path to the desired resource within 
-     * the weblog's uploads area.
+     * @param fileId file identifier from database.
      *
      * @throws FileNotFoundException If path does not exist.
      * @throws FilePathException If path is invalid, or can't be read.
@@ -100,6 +99,13 @@
     
     /**
      * Determine if file can be saved given current WebloggerConfig settings.
+     * 
+     * @param weblog The weblog we are working on.
+     * @param fileName name of the file to be saved
+     * @param contentType content type of the file
+     * @param size size of the file in bytes.
+     * @param messages output parameter for adding messages.
+     * @return true if the file can be saved, false otherwise. 
      */
     public boolean canSave(Weblog weblog,
     		               String fileName,

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java Fri May  8 03:10:24 2009
@@ -174,7 +174,8 @@
     
     
     /**
-     * Determine if file can be saved given current WebloggerConfig settings.
+     * @see org.apache.roller.weblogger.model.FileContentManager#canSave(
+     * weblog, java.lang.String, java.lang.String, long, messages)
      */
     public boolean canSave(Weblog weblog,
     		               String fileName,

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManager.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManager.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManager.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManager.java Fri May  8 03:10:24 2009
@@ -27,30 +27,98 @@
 import org.apache.roller.weblogger.pojos.MediaFileFilter;
 import org.apache.roller.weblogger.pojos.Weblog;
 
+/**
+ * Interface to media file management.
+ */
 public interface MediaFileManager {
 
+    /**
+     * Create a media file
+     */
 	public void createMediaFile(Weblog weblog, MediaFile mediaFile) throws WebloggerException ;
+
+    /**
+     * Update metadata for a media file
+     */
 	public void updateMediaFile(Weblog weblog, MediaFile mediaFile) throws WebloggerException ;
+
+    /**
+     * Get media file metadata by file id
+     */
 	public MediaFile getMediaFile(String id) throws WebloggerException;
+
+    /**
+     * Get media file metadata optionally including the actual content
+     */
 	public MediaFile getMediaFile(String id, boolean includeContent) throws WebloggerException;
+
+    /**
+     * Delete a media file
+     */
 	public void removeMediaFile(Weblog weblog, MediaFile mediaFile) throws WebloggerException;
 
+    /**
+     * Search for media files based on the filter criteria
+     */
 	public List<MediaFile> searchMediaFiles(Weblog weblog, MediaFileFilter filter) throws WebloggerException;
 
+    /**
+     * Create root directory for media files in a weblog.
+     */
 	public MediaFileDirectory createRootMediaFileDirectory(Weblog weblog) throws WebloggerException;
+
+    /**
+     * Create a media file directory with the given name
+     */
 	public MediaFileDirectory createMediaFileDirectory(MediaFileDirectory parentDirectory, String newDirName) throws WebloggerException;
+
+    /**
+     * Create a media file directory
+     */
 	public void createMediaFileDirectory(MediaFileDirectory directory) throws WebloggerException;
+
+    /**
+     * Create a media file directory given its path
+     */
 	public MediaFileDirectory createMediaFileDirectoryByPath(Weblog weblog, String path) throws WebloggerException; 
 
+    /**
+     * Get media file directory by id
+     */
 	public MediaFileDirectory getMediaFileDirectory(String id) throws WebloggerException;
+
+    /**
+     * Get media file directory by its path
+     */
 	public MediaFileDirectory getMediaFileDirectoryByPath(Weblog weblog, String path) throws WebloggerException; 
+
+    /**
+     * Get the list of media file directories for the given weblog.
+     */
 	public List<MediaFileDirectory> getMediaFileDirectories(Weblog weblog) throws WebloggerException;
-    public MediaFileDirectory getMediaFileRootDirectory(Weblog weblog) throws WebloggerException;
+
+    /**
+     * Get the root directory for media files for the given weblog.
+     */
+	public MediaFileDirectory getMediaFileRootDirectory(Weblog weblog) throws WebloggerException;
     
+    /**
+     * Move a set of media files to a new directory.
+     */
     public void moveMediaFiles(Collection<MediaFile> mediaFiles, MediaFileDirectory directory) throws WebloggerException;
+
+    /**
+     * Move one media file to a new directory.
+     */
     public void moveMediaFile(MediaFile mediaFile, MediaFileDirectory directory) throws WebloggerException;
 
+    /**
+     * Return recently added media files that are public.
+     */
  	public List<MediaFile> fetchRecentPublicMediaFiles(int length) throws WebloggerException;
 
+    /**
+     * Release all resources.
+     */
  	public void release();
 }

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java Fri May  8 03:10:24 2009
@@ -65,6 +65,9 @@
 		
 	}
 	
+	/**
+	 * {@inheritDoc}
+	 */
 	public void moveMediaFiles(Collection<MediaFile> mediaFiles, MediaFileDirectory targetDirectory) 
         throws WebloggerException {
     	for (MediaFile mediaFile: mediaFiles) {
@@ -75,11 +78,17 @@
         roller.getWeblogManager().saveWeblog(targetDirectory.getWeblog());
     }
 
+	/**
+	 * {@inheritDoc}
+	 */
 	public void moveMediaFile(MediaFile mediaFile, MediaFileDirectory targetDirectory) 
         throws WebloggerException {
 		moveMediaFiles(Arrays.asList(mediaFile), targetDirectory);
 	}
 	
+	/**
+	 * {@inheritDoc}
+	 */
 	public MediaFileDirectory createMediaFileDirectory(MediaFileDirectory parentDirectory, String newDirName) 
 	  throws WebloggerException {
 		
@@ -95,6 +104,9 @@
         return newDirectory;
 	}
 	
+	/**
+	 * {@inheritDoc}
+	 */
 	public void createMediaFileDirectory(MediaFileDirectory directory) 
 	  throws WebloggerException {
 		this.persistenceStrategy.store(directory);
@@ -103,6 +115,9 @@
         roller.getWeblogManager().saveWeblog(directory.getWeblog());
 	}
 	
+	/**
+	 * {@inheritDoc}
+	 */
 	public MediaFileDirectory createMediaFileDirectoryByPath(Weblog weblog, String path) 
 	    throws WebloggerException {
 		if (path.startsWith("/")) {
@@ -151,6 +166,9 @@
         return newDirectory;
 	}
 	
+	/**
+	 * {@inheritDoc}
+	 */
 	public MediaFileDirectory createRootMediaFileDirectory(Weblog weblog) 
 	    throws WebloggerException {
         MediaFileDirectory rootDirectory = new MediaFileDirectory(null, "root", "root directory", weblog);
@@ -158,8 +176,9 @@
 		return rootDirectory;
 	}
 
-	
-
+	/**
+	 * {@inheritDoc}
+	 */
 	public void createMediaFile(Weblog weblog, MediaFile mediaFile) throws WebloggerException {
 		
         FileContentManager cmgr = WebloggerFactory.getWeblogger().getFileContentManager();
@@ -177,6 +196,9 @@
         cmgr.saveFileContent(weblog, mediaFile.getId(), mediaFile.getInputStream());
 	}
 	
+	/**
+	 * {@inheritDoc}
+	 */
 	public void updateMediaFile(Weblog weblog, MediaFile mediaFile) throws WebloggerException {
 		mediaFile.setLastUpdated(new Timestamp(System.currentTimeMillis()));
 		persistenceStrategy.store(mediaFile);
@@ -184,10 +206,16 @@
         roller.getWeblogManager().saveWeblog(weblog);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	public MediaFile getMediaFile(String id) throws WebloggerException {
         return getMediaFile(id, false);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	public MediaFile getMediaFile(String id, boolean includeContent) throws WebloggerException {
 		MediaFile mediaFile = (MediaFile) this.persistenceStrategy.load(MediaFile.class, id);
 		if (includeContent) {
@@ -198,8 +226,11 @@
         return mediaFile;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	public MediaFileDirectory getMediaFileDirectoryByPath(Weblog weblog, String path) 
-    throws WebloggerException {
+      throws WebloggerException {
         Query q = this.persistenceStrategy.getNamedQuery("MediaFileDirectory.getByWeblogAndPath");
         q.setParameter(1, weblog);
         q.setParameter(2, path);
@@ -210,15 +241,19 @@
         }
     }
 
-
-	
+	/**
+	 * {@inheritDoc}
+	 */
 	public MediaFileDirectory getMediaFileDirectory(String id) 
 	    throws WebloggerException {
 		return (MediaFileDirectory) this.persistenceStrategy.load(MediaFileDirectory.class, id);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	public MediaFileDirectory getMediaFileRootDirectory(Weblog weblog) 
-    throws WebloggerException {
+      throws WebloggerException {
         Query q = this.persistenceStrategy.getNamedQuery("MediaFileDirectory.getByWeblogAndNoParent");
         q.setParameter(1, weblog);
         try {
@@ -228,6 +263,9 @@
         }
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	public List<MediaFileDirectory> getMediaFileDirectories(Weblog weblog) 
 	    throws WebloggerException {
         
@@ -236,6 +274,9 @@
         return q.getResultList();
 	}
 	
+	/**
+	 * {@inheritDoc}
+	 */
 	public void removeMediaFile(Weblog weblog, MediaFile mediaFile) 
 	    throws WebloggerException {
         FileContentManager cmgr = WebloggerFactory.getWeblogger().getFileContentManager();
@@ -252,6 +293,9 @@
         }
 	}
 	
+	/**
+	 * {@inheritDoc}
+	 */
  	public List<MediaFile> fetchRecentPublicMediaFiles(int length) 
  	    throws WebloggerException {
 
@@ -267,6 +311,9 @@
         return query.getResultList();
  	}
  	
+	/**
+	 * {@inheritDoc}
+	 */
 	public List<MediaFile> searchMediaFiles(Weblog weblog, MediaFileFilter filter) 
 	     throws WebloggerException {
         
@@ -350,35 +397,4 @@
         return query.getResultList();
 	}
 	
-	public static void main(String[] args) {
-		/**
-		MediaFileManagerImpl impl = new MediaFileManagerImpl(null, null);
-		
-		MediaFileFilter filter = new MediaFileFilter();
-		filter.setName("testname");
-
-		filter.setSize(3);
-		filter.setSizeFilterType(MediaFileFilter.SizeFilterType.EQ);
-		
-		List<String> tags = new ArrayList<String>();
-		tags.add("test1");
-		tags.add("test2");
-		filter.setTags(tags);
-		
-		filter.setType(MediaFileType.IMAGE);
-
-		System.out.println(impl.searchMediaFiles(null, filter));
-		*/
-	}
-	
-	
-	
-	
-	
-	/*
-	public void searchMediaFiles(MediaFileSearchCriteria searchCriteria) {
-		
-	}
-	*/
-
 }

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/FileContent.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/FileContent.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/FileContent.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/FileContent.java Fri May  8 03:10:24 2009
@@ -24,8 +24,7 @@
 
 
 /**
- * A FileContentManagerImpl specific implementation that represents the content
- * of a file from file system.
+ * Represents the content of a file from file system.
  *
  */
 public class FileContent {
@@ -43,7 +42,7 @@
     public FileContent(Weblog weblog, String fileId, File file) {
         this.weblog = weblog;
         this.fileId = fileId;
-        resourceFile = file;
+        this.resourceFile = file;
     }
     
     public Weblog getWeblog() {
@@ -66,6 +65,9 @@
         return resourceFile.length();
     }
     
+    /**
+     * Returns the input stream for the underlying file.
+     */
     public InputStream getInputStream() {
         try {
             return new FileInputStream(resourceFile);

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java Fri May  8 03:10:24 2009
@@ -28,10 +28,8 @@
 import org.apache.roller.weblogger.business.WebloggerFactory;
 
 /**
- * Media file
+ * Representa a media file
  *
- * @hibernate.cache usage="read-write"
- * @hibernate.class lazy="true" table="media_file"
  */
 public class MediaFile {
     private static Log log =
@@ -61,8 +59,6 @@
 	/**
 	 * Name for the media file
 	 * 
-     * @ejb:persistent-field
-     * @hibernate.property column="name" non-null="true" unique="false"
 	 */
 	public String getName() {
 		return name;
@@ -75,8 +71,6 @@
 	/**
 	 * Description for media file
 	 * 
-     * @ejb:persistent-field
-     * @hibernate.property column="description" unique="false"
 	 */
 	public String getDescription() {
 		return description;
@@ -89,8 +83,6 @@
 	/**
 	 * Copyright text for media file
 	 * 
-     * @ejb:persistent-field
-     * @hibernate.property column="copyright_text" unique="false"
 	 */
 	public String getCopyrightText() {
 		return copyrightText;
@@ -103,7 +95,6 @@
 	/**
 	 * Is media file shared for gallery
 	 * 
-     * @hibernate.property column="is_public" non-null="true" unique="false"
 	 */
 	public Boolean isSharedForGallery() {
 		return isSharedForGallery;
@@ -116,8 +107,6 @@
 	/**
 	 * Size of the media file
 	 * 
-     * @ejb:persistent-field
-     * @hibernate.property column="size_in_bytes" non-null="true" unique="false"
 	 */
 	public long getLength() {
 		return length;
@@ -128,9 +117,8 @@
 	}
 
     /**
-     * @ejb:persistent-field
-     * @hibernate.property column="date_uploaded" non-null="true" unique="false"
-     * @roller.wrapPojoMethod type="simple"
+     * Date uploaded
+     * 
      */
 	public Timestamp getDateUploaded() {
 		return dateUploaded;
@@ -145,9 +133,8 @@
 	}
 
 	/**
-     * @ejb:persistent-field
-     * @hibernate.property column="last_updated" unique="false"
-     * @roller.wrapPojoMethod type="simple"
+	 * Last updated timestamp
+	 * 
      */
 	public Timestamp getLastUpdated() {
 		return lastUpdated;
@@ -165,12 +152,9 @@
 		this.directory = dir;
 	}
 
-	/*
+	/**
 	 * Set of tags for this media file
 	 * 
-     * @hibernate.collection-key column="media_file_id"
-     * @hibernate.collection-one-to-many class="org.apache.roller.weblogger.pojos.MediaFileTag"
-     * @hibernate.set lazy="true" inverse="true" cascade="delete" 
 	 */
 	public Set<MediaFileTag> getTags() {
 		return tags;
@@ -183,8 +167,6 @@
 	/**
 	 * Content type of the media file
 	 * 
-     * @ejb:persistent-field
-     * @hibernate.property column="content_type" non-null="true" unique="false"
 	 */
 	public String getContentType() {
 		return contentType;
@@ -198,10 +180,6 @@
      * Database surrogate key.
      *
      * @roller.wrapPojoMethod type="simple"
-     *
-     * @ejb:persistent-field
-     * @hibernate.id column="id"
-     *  generator-class="assigned"  
      */
 	public String getId() {
 		return id;
@@ -211,6 +189,10 @@
 		return directory.getPath();
 	}
 
+	/**
+	 * Returns input stream for the underlying file in the file system.
+	 * @return
+	 */
 	public InputStream getInputStream() {
 		if (is != null) {
 			return is;
@@ -229,12 +211,20 @@
 		this.content = content;
 	}
 	
+	/**
+	 * Indicates whether this is an image file.
+	 * 
+	 */
 	public boolean isImageFile() {
 		if (this.contentType == null) return false;
 		return (this.contentType.toLowerCase().startsWith(
 				MediaFileType.IMAGE.getContentTypePrefix().toLowerCase()));
 	}
 
+	/**
+	 * Returns permalink URL for this media file resource.
+	 * 
+	 */
 	public String getPermalink() {
         return WebloggerFactory.getWeblogger().getUrlStrategy().getMediaFileURL(
         		this.id, true);

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileComparator.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileComparator.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileComparator.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileComparator.java Fri May  8 03:10:24 2009
@@ -1,16 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
 package org.apache.roller.weblogger.pojos;
 
 import java.util.Comparator;
 
+/**
+ * Compares media files based on the type passed.
+ * 
+ * Implements java.util.Comparator interface so this can be used
+ * for comparing and sorting media files.
+ *  
+ */
 public class MediaFileComparator implements Comparator<MediaFile> {
 	
+	/**
+	 * Comparator types that define all possible attributes for comparing media files. 
+	 *
+	 */
 	public enum MediaFileComparatorType {NAME, TYPE, DATE_UPLOADED};
+
+	// Comparator type associated with this instance of media file comparator
 	MediaFileComparatorType type;
 	
 	public MediaFileComparator(MediaFileComparatorType type) {
 		this.type = type;
 	}
 
+	/**
+	 * Compares media files based on the attribute associated with this comparator
+	 * 
+	 */
 	public int compare(MediaFile file1, MediaFile file2) {
 		switch (this.type) {
 		    case NAME: return file1.getName().compareTo(file2.getName());

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectory.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectory.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectory.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectory.java Fri May  8 03:10:24 2009
@@ -18,14 +18,13 @@
 
 package org.apache.roller.weblogger.pojos;
 
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 /**
- * Media file directory.
+ * Represents a Media file directory.
  * 
  */
 public class MediaFileDirectory {
@@ -69,12 +68,6 @@
     /**
      * Database surrogate key.
      *
-     * @roller.wrapPojoMethod type="simple"
-     *
-     * @ejb:persistent-field
-     *
-     * @hibernate.id column="id"
-     *     generator-class="assigned"  
      */
 	public String getId() {
 		return id;
@@ -83,19 +76,11 @@
     /**
      * A short name for this folder.
      *
-     * @roller.wrapPojoMethod type="simple"
-     *
-     * @ejb:persistent-field
-     *
-     * @hibernate.property column="name" non-null="true" unique="false"
      */
 	public String getName() {
 		return name;
 	}
 
-	/**
-     * @ejb:persistent-field
-	 */
 	public void setName(String name) {
 		this.name = name;
 	}
@@ -103,19 +88,11 @@
     /**
      * A full description for this folder.
      *
-     * @roller.wrapPojoMethod type="simple"
-     *
-     * @ejb:persistent-field
-     *
-     * @hibernate.property column="description" unique="false"
      */
 	public String getDescription() {
 		return description;
 	}
 
-	/**
-     * @ejb:persistent-field
-	 */
 	public void setDescription(String description) {
 		this.description = description;
 	}
@@ -123,19 +100,11 @@
     /**
      * Return parent folder, or null if folder is root of hierarchy.
      *
-     * @roller.wrapPojoMethod type="pojo"
-     *
-     * @ejb:persistent-field
-     *
-     * @hibernate.many-to-one column="parentid" cascade="none" not-null="false"
      */
 	public MediaFileDirectory getParent() {
 		return parent;
 	}
 
-	/**
-     * @ejb:persistent-field
-	 */
 	public void setParent(MediaFileDirectory parent) {
 		this.parent = parent;
 	}
@@ -143,19 +112,11 @@
     /**
      * Get the weblog which owns this folder.
      *
-     * @roller.wrapPojoMethod type="pojo"
-     *
-     * @ejb:persistent-field
-     *
-     * @hibernate.many-to-one column="websiteid" cascade="none" not-null="true"
      */
 	public Weblog getWeblog() {
 		return weblog;
 	}
 
-	/**
-     * @ejb:persistent-field
-	 */
 	public void setWeblog(Weblog weblog) {
 		this.weblog = weblog;
 	}
@@ -163,32 +124,31 @@
     /**
      * The full path to this folder in the hierarchy.
      *
-     * @roller.wrapPojoMethod type="simple"
-     *
-     * @ejb:persistent-field
-     *
-     * @hibernate.property column="path" non-null="true" unique="false"
      */
 	public String getPath() {
 		return path;
 	}
 
-	/**
-     * @ejb:persistent-field
-	 */
 	public void setPath(String path) {
 		this.path = path;
 	}
 	
+    /**
+     * The collection of files in this directory
+     * 
+     */
+	public Set<MediaFile> getMediaFiles() {
+		return mediaFiles;
+	}
+
+	public void setMediaFiles(Set<MediaFile> mediaFiles) {
+		this.mediaFiles = mediaFiles;
+	}
+
 	
     /**
      * Get child folders of this folder.
      *
-     * @roller.wrapPojoMethod type="pojo-collection" class="org.apache.roller.weblogger.pojos.WeblogBookmarkFolder"
-     *
-     * @hibernate.set lazy="true" inverse="true" cascade="delete" 
-     * @hibernate.collection-key column="parentid"
-     * @hibernate.collection-one-to-many class="org.apache.roller.weblogger.pojos.WeblogBookmarkFolder"
      */
     public Set<MediaFileDirectory> getChildDirectories() {
         return this.childDirectories;
@@ -198,6 +158,12 @@
         this.childDirectories = folders;
     }
     
+    /**
+     * Indicates whether this directory contains the specified file.
+     * 
+     * @param name file name
+     * @return true if the file is present in the directory, false otherwise.
+     */
     public boolean hasMediaFile(String name) {
     	Set<MediaFile> fileSet = this.getMediaFiles();
     	if (fileSet == null) 
@@ -210,6 +176,12 @@
     	return false;
     }
     
+    /**
+     * Returns file with the given name, if present in this directory
+     * 
+     * @param name file name
+     * @return media file object
+     */
     public MediaFile getMediaFile(String name) {
     	Set<MediaFile> fileSet = this.getMediaFiles();
     	if (fileSet == null) 
@@ -222,6 +194,12 @@
     	return null;
     }
     
+    /**
+     * Indicates whether this directory contains the specified sub-directory.
+     * 
+     * @param name directory name
+     * @return true if the sub-directory is present, false otherwise.
+     */
     public boolean hasDirectory(String name) {
     	Set<MediaFileDirectory> dirSet = this.getChildDirectories();
     	for (MediaFileDirectory directory: dirSet) {
@@ -232,21 +210,18 @@
     	return false;
     }
     
+    /**
+     * Creates a new sub-directory
+     * 
+     * @param name new directory name
+     * @return reference to the newly created directory.
+     */
     public MediaFileDirectory createNewDirectory(String name) {
     	MediaFileDirectory newDirectory = new MediaFileDirectory(this, name, "", this.getWeblog());
     	this.getChildDirectories().add(newDirectory);
     	return newDirectory;
     }
     
-    
-    public Set<MediaFile> getMediaFiles() {
-		return mediaFiles;
-	}
-
-	public void setMediaFiles(Set<MediaFile> mediaFiles) {
-		this.mediaFiles = mediaFiles;
-	}
-
 	@Override
 	public boolean equals(Object other) {
         if (other == this) return true;

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectoryComparator.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectoryComparator.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectoryComparator.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileDirectoryComparator.java Fri May  8 03:10:24 2009
@@ -1,16 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
 package org.apache.roller.weblogger.pojos;
 
 import java.util.Comparator;
 
+/**
+ * Compares media file directories based on name or path.
+ * 
+ * Implements java.util.Comparator interface so this can be used
+ * for comparing and sorting directories.
+ *  
+ */
 public class MediaFileDirectoryComparator implements Comparator<MediaFileDirectory> {
 	
+	/**
+	 * Comparator types that define all possible attributes for comparing media file directories. 
+	 *
+	 */
 	public enum DirectoryComparatorType {NAME, PATH};
+	
+	// Comparator type associated with this instance of media directory comparator
 	DirectoryComparatorType type;
 	
 	public MediaFileDirectoryComparator(DirectoryComparatorType type) {
 		this.type = type;
 	}
 
+	/**
+	 * Compares directories based on the attribute associated with this comparator
+	 * 
+	 */
 	public int compare(MediaFileDirectory dir1, MediaFileDirectory dir2) {
 		switch (this.type) {
 		    case NAME: return dir1.getName().compareTo(dir2.getName());

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileFilter.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileFilter.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileFilter.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileFilter.java Fri May  8 03:10:24 2009
@@ -1,17 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
 package org.apache.roller.weblogger.pojos;
 
 import java.util.List;
 
+/**
+ * Represents the search criteria for media files.
+ *
+ */
 public class MediaFileFilter {
 	
+	/**
+	 * Enumeration of the ways in which size can be used to filter media files. 
+	 *
+	 */
 	public enum SizeFilterType {GT, GTE, EQ, LT, LTE};
+
+	/**
+	 * Enumeration of possible sort orders for media files. 
+	 *
+	 */
 	public enum MediaFileOrder {NAME, DATE_UPLOADED, TYPE};
 
+	// Search criteria - name
 	String name;
+
+	// Search criteria - media file type
 	MediaFileType type;
+
+	// Search criteria - media file size in bytes
 	long size;
+
+	// Search criteria - way in which media file size should be applied (greater than, less than etc)
 	SizeFilterType sizeFilterType;
+	
+	// Search criteria - list of tags
 	List<String> tags;
+	
+	// sort order for search results
 	MediaFileOrder order;
 	
 	/**
@@ -22,6 +64,7 @@
 	 * returned. length will be ignored in this case.
 	 */
 	int startIndex = -1;
+	
 	/**
 	 * Number of results to be returned starting from startIndex.
 	 */

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileTag.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileTag.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileTag.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileTag.java Fri May  8 03:10:24 2009
@@ -18,25 +18,15 @@
 
 package org.apache.roller.weblogger.pojos;
 
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.NamedQuery;
-import javax.persistence.Table;
-
 import org.apache.roller.util.UUIDGenerator;
 
-@Entity
-@Table (name="media_file_tag")
-@NamedQuery (
-		name="MediaFileTag.getByMediaFile",
-		query="SELECT w FROM MediaFileTag w WHERE w.mediaFile = ?1")
+/**
+ * Represents the tag for media files.
+ *
+ */
 public class MediaFileTag {
 	
-	@Id
 	String id = UUIDGenerator.generateUUID();
-	
-	//@Column "name"
 	String name;
 	MediaFile mediaFile;
 	

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileType.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileType.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileType.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFileType.java Fri May  8 03:10:24 2009
@@ -1,14 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
 package org.apache.roller.weblogger.pojos;
 
+/**
+ * Enumeration that defines all possible types of media files.
+ *
+ */
 public enum MediaFileType {
 
-	AUDIO("audio", "Audio", "audio/"), 
-	VIDEO("video", "Video", "video/"),  
-	IMAGE("image", "Image", "image/"),
-	OTHERS("default", "Others", null);
+	AUDIO("audio", "Audio", "audio/"),  // audio files 
+	VIDEO("video", "Video", "video/"),  // video files
+	IMAGE("image", "Image", "image/"),  // image files
+	OTHERS("default", "Others", null);  // all other types
 
+	// Content type prefix used by files of this type
 	String contentTypePrefix;
+	
+	// A unique identifier for this file type.
 	String id;
+	
+	// Description for this file type.
 	String description;
 	
 	MediaFileType(String id, String desc, String prefix) {

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java Fri May  8 03:10:24 2009
@@ -57,7 +57,6 @@
         
     }
 
-
     /**
      * Handles requests for user uploaded media file resources.
      */

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java Fri May  8 03:10:24 2009
@@ -26,14 +26,12 @@
 import org.apache.struts2.interceptor.validation.SkipValidation;
 
 /**
- * Prepares creating a new weblog entry with a pointer to a media file.
+ * Prepares creation of a new weblog entry with an embedded pointer to a media file.
  */
 @SuppressWarnings("serial")
 public class EntryAddWithMediaFile extends MediaFileBase {
     private static Log log = LogFactory.getLog(EntryAddWithMediaFile.class);
     
-    private String mediaFileId; 
-
     // bean for managing form data
     private EntryBean bean = new EntryBean();
 
@@ -49,7 +47,7 @@
     public String execute() {
     	MediaFileManager manager = WebloggerFactory.getWeblogger().getMediaFileManager();
 		try {
-			MediaFile mediaFile = manager.getMediaFile(this.mediaFileId);
+			MediaFile mediaFile = manager.getMediaFile(getMediaFileId());
 			String link;
 			if (mediaFile.isImageFile()) {
 				link = "<img src='<url>' alt='<name>' width='<width>' height='<height>' />";
@@ -72,14 +70,6 @@
 		return SUCCESS;
     }
 
-	public String getMediaFileId() {
-		return mediaFileId;
-	}
-
-	public void setMediaFileId(String mediaFileId) {
-		this.mediaFileId = mediaFileId;
-	}
-
 	public EntryBean getBean() {
 		return bean;
 	}

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java Fri May  8 03:10:24 2009
@@ -59,6 +59,9 @@
         this.pageTitle = "mediaFile.add.title";
     }
     
+    /**
+     * Prepares action class
+     */
     public void myPrepare() {
         System.out.println("Into myprepare");
     	refreshAllDirectories();
@@ -117,6 +120,9 @@
 		return INPUT;
     }
     
+    /**
+     * Validates media file to be added.
+     */
     public void myValidate() {
         if (getDirectory().hasMediaFile(getBean().getName())) {
             addError("MediaFile.error.duplicateName", getBean().getName());

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java Fri May  8 03:10:24 2009
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
 package org.apache.roller.weblogger.ui.struts2.editor;
 
 import java.util.ArrayList;
@@ -15,6 +33,10 @@
 import org.apache.roller.weblogger.pojos.MediaFileDirectoryComparator.DirectoryComparatorType;
 import org.apache.roller.weblogger.ui.struts2.util.UIAction;
 
+/**
+ * Base class for all actions related to media files.
+ *
+ */
 @SuppressWarnings("serial")
 public class MediaFileBase extends UIAction {
     private static Log log = LogFactory.getLog(MediaFileBase.class);
@@ -27,6 +49,9 @@
     
     private boolean overlayMode;
     
+    /**
+     * Deletes media file
+     */
     protected void doDeleteMediaFile() {
         
     	try {
@@ -44,6 +69,9 @@
 		}
     }
     
+    /**
+     * Shares media file for public gallery
+     */
     protected void doIncludeMediaFileInGallery() {
         
     	try {
@@ -63,6 +91,9 @@
     }
     
 
+    /**
+     * Delete selected media files.
+     */
     protected void doDeleteSelected() {
         String[] fileIds = getSelectedMediaFiles();
         if (fileIds != null && fileIds.length > 0) {
@@ -88,6 +119,9 @@
         }
     }
     
+    /**
+     * Move selected media files to a directory.
+     */
     protected void doMoveSelected() {
         String[] fileIds = getSelectedMediaFiles();
         if (fileIds != null && fileIds.length > 0) {
@@ -114,6 +148,9 @@
         }
     }
 
+    /**
+     * Refresh the list of directories.
+     */
     protected void refreshAllDirectories() {
         try {
             MediaFileManager mgr = WebloggerFactory.getWeblogger().getMediaFileManager();
@@ -129,8 +166,6 @@
     
     /**
      * Constructs the external URL for a given media file
-     * @param mediaFile
-     * @return
      */
     protected String getMediaFileURL(MediaFile mediaFile) {
     	return getSiteURL() + "/roller-ui/rendering/media-resources/" + mediaFile.getId();

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java Fri May  8 03:10:24 2009
@@ -21,12 +21,8 @@
 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.business.MediaFileManager;
-import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.MediaFile;
-import org.apache.roller.weblogger.pojos.MediaFileDirectory;
 import org.apache.roller.weblogger.pojos.MediaFileTag;
 
 
@@ -43,43 +39,6 @@
     String directoryId;
     boolean isSharedForGallery;
 
-    public void copyTo(MediaFile dataHolder) throws WebloggerException {
-    	
-    	dataHolder.setName(this.name);
-    	dataHolder.setDescription(this.description);
-    	dataHolder.setCopyrightText(this.copyrightText);
-
-    	Set<MediaFileTag> tagsSet = new HashSet<MediaFileTag>();  
-    	for (String tag: this.tags.split(" ")) {
-    		tagsSet.add(new MediaFileTag(tag, dataHolder));
-    	}
-    	dataHolder.setTags(tagsSet);
-    	dataHolder.setSharedForGallery(this.isSharedForGallery);
-    }
-    
-    
-    public void copyFrom(MediaFile dataHolder) {
-    	this.setId(dataHolder.getId());
-    	this.setName(dataHolder.getName());
-    	this.setDescription(dataHolder.getDescription());
-    	this.setCopyrightText(dataHolder.getCopyrightText());
-    	
-    	Set<MediaFileTag> tags = dataHolder.getTags();
-    	if (tags != null && !tags.isEmpty()) {
-        	StringBuffer tagDisplayBuffer = new StringBuffer();
-        	for (MediaFileTag tag: dataHolder.getTags()) {
-        		tagDisplayBuffer.append(tag.getName());
-        		tagDisplayBuffer.append(" ");
-        	}
-        	tagDisplayBuffer.deleteCharAt(tagDisplayBuffer.length() - 1);
-        	this.setTags(tagDisplayBuffer.toString());
-    	}
-    	
-    	this.setSharedForGallery(dataHolder.isSharedForGallery());
-    	this.setDirectoryId(dataHolder.getDirectory().getId());
-    }
-
-
 	public String getName() {
 		return name;
 	}
@@ -150,4 +109,49 @@
 	}
 	
     
+    /**
+     * Copies the contents of this bean to a media file object
+     * 
+     */
+	public void copyTo(MediaFile dataHolder) throws WebloggerException {
+    	
+    	dataHolder.setName(this.name);
+    	dataHolder.setDescription(this.description);
+    	dataHolder.setCopyrightText(this.copyrightText);
+
+    	Set<MediaFileTag> tagsSet = new HashSet<MediaFileTag>();  
+    	for (String tag: this.tags.split(" ")) {
+    		tagsSet.add(new MediaFileTag(tag, dataHolder));
+    	}
+    	dataHolder.setTags(tagsSet);
+    	dataHolder.setSharedForGallery(this.isSharedForGallery);
+    }
+    
+    
+    /**
+     * Populates this bean from a media file object. 
+     * 
+     */
+    public void copyFrom(MediaFile dataHolder) {
+    	this.setId(dataHolder.getId());
+    	this.setName(dataHolder.getName());
+    	this.setDescription(dataHolder.getDescription());
+    	this.setCopyrightText(dataHolder.getCopyrightText());
+    	
+    	Set<MediaFileTag> tags = dataHolder.getTags();
+    	if (tags != null && !tags.isEmpty()) {
+        	StringBuffer tagDisplayBuffer = new StringBuffer();
+        	for (MediaFileTag tag: dataHolder.getTags()) {
+        		tagDisplayBuffer.append(tag.getName());
+        		tagDisplayBuffer.append(" ");
+        	}
+        	tagDisplayBuffer.deleteCharAt(tagDisplayBuffer.length() - 1);
+        	this.setTags(tagDisplayBuffer.toString());
+    	}
+    	
+    	this.setSharedForGallery(dataHolder.isSharedForGallery());
+    	this.setDirectoryId(dataHolder.getDirectory().getId());
+    }
+
+
 }

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java Fri May  8 03:10:24 2009
@@ -18,11 +18,6 @@
 
 package org.apache.roller.weblogger.ui.struts2.editor;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Collections;
-import java.util.List;
-
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -30,45 +25,53 @@
 import org.apache.roller.weblogger.business.FileIOException;
 import org.apache.roller.weblogger.business.MediaFileManager;
 import org.apache.roller.weblogger.business.WebloggerFactory;
-import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.pojos.MediaFile;
 import org.apache.roller.weblogger.pojos.MediaFileDirectory;
-import org.apache.roller.weblogger.ui.struts2.util.UIAction;
 import org.apache.struts2.interceptor.validation.SkipValidation;
 
 /**
- * Adds a new media file.
+ * Edits metadata for a media file.
  */
 @SuppressWarnings("serial")
-public class MediaFileEdit extends UIAction {
+public class MediaFileEdit extends MediaFileBase {
     private static Log log = LogFactory.getLog(MediaFileEdit.class);
     
-    private String mediaFileId; 
-
     private MediaFileBean bean =  new MediaFileBean();
     private MediaFileDirectory directory;
     
-    private List<MediaFileDirectory> allDirectories;
-
     public MediaFileEdit() {
         this.actionName = "mediaFileEdit";
         this.desiredMenu = "editor";
         this.pageTitle = "mediaFile.edit.title";
     }
     
+    /**
+     * Prepares edit action.
+     */
     public void myPrepare() {
-        try {
+    	refreshAllDirectories();
+    	try {
             MediaFileManager mgr = WebloggerFactory.getWeblogger().getMediaFileManager();
-            setAllDirectories(mgr.getMediaFileDirectories(getActionWeblog()));
             if(!StringUtils.isEmpty(bean.getDirectoryId())) {
                 setDirectory(mgr.getMediaFileDirectory(bean.getDirectoryId()));
             }
         } catch (WebloggerException ex) {
             log.error("Error looking up media file directory", ex);
         }
+    	
     }
 
     /**
+     * Validates media file metadata to be updated.
+     */
+    public void myValidate() {
+    	MediaFile fileWithSameName = getDirectory().getMediaFile(getBean().getName());
+        if (fileWithSameName != null && !fileWithSameName.getId().equals(getMediaFileId())) {
+            addError("MediaFile.error.duplicateName", getBean().getName());
+        }
+    }
+    
+    /**
      * Show form for adding a new media file.
      * 
      * @return String The result of the action.
@@ -77,7 +80,7 @@
     public String execute() {
 		MediaFileManager manager = WebloggerFactory.getWeblogger().getMediaFileManager();
 		try {
-			MediaFile mediaFile = manager.getMediaFile(this.mediaFileId);
+			MediaFile mediaFile = manager.getMediaFile(getMediaFileId());
 			this.bean.copyFrom(mediaFile);
         } catch (FileIOException ex) {
             addError("uploadFiles.error.upload", bean.getName());
@@ -100,7 +103,7 @@
     	if (!hasActionErrors()) {
     		MediaFileManager manager = WebloggerFactory.getWeblogger().getMediaFileManager();
     		try {
-    			MediaFile mediaFile = manager.getMediaFile(this.mediaFileId);
+    			MediaFile mediaFile = manager.getMediaFile(getMediaFileId());
     			bean.copyTo(mediaFile);
 				manager.updateMediaFile(getActionWeblog(), mediaFile);
 	            WebloggerFactory.getWeblogger().flush();
@@ -118,13 +121,6 @@
 		return INPUT;
     }
     
-    public void myValidate() {
-    	MediaFile fileWithSameName = getDirectory().getMediaFile(getBean().getName());
-        if (fileWithSameName != null && !fileWithSameName.getId().equals(this.mediaFileId)) {
-            addError("MediaFile.error.duplicateName", getBean().getName());
-        }
-    }
-    
     public MediaFileBean getBean() {
     	return bean;
     }
@@ -133,22 +129,6 @@
     	this.bean = b;
     }
     
-	public List<MediaFileDirectory> getAllDirectories() {
-		return allDirectories;
-	}
-    
-	public void setAllDirectories(List<MediaFileDirectory> dirs) {
-		this.allDirectories = dirs;
-	}
-
-	public String getMediaFileId() {
-		return mediaFileId;
-	}
-
-	public void setMediaFileId(String mediaFileId) {
-		this.mediaFileId = mediaFileId;
-	}
-
 	public MediaFileDirectory getDirectory() {
 		return directory;
 	}

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageDim.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageDim.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageDim.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageDim.java Fri May  8 03:10:24 2009
@@ -18,24 +18,16 @@
 
 package org.apache.roller.weblogger.ui.struts2.editor;
 
-import java.io.File;
-import java.io.FileInputStream;
-
-import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
-import org.apache.roller.weblogger.business.FileIOException;
 import org.apache.roller.weblogger.business.MediaFileManager;
 import org.apache.roller.weblogger.business.WebloggerFactory;
-import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.pojos.MediaFile;
-import org.apache.roller.weblogger.pojos.MediaFileDirectory;
-import org.apache.roller.weblogger.pojos.MediaFileType;
 import org.apache.struts2.interceptor.validation.SkipValidation;
 
 /**
- * Adds a new media file.
+ * Action class for choosing image dimensions.
  */
 @SuppressWarnings("serial")
 public class MediaFileImageDim extends MediaFileBase {
@@ -48,7 +40,7 @@
     }
     
     /**
-     * Show form for adding a new media file.
+     * Show form for choosing image dimension.
      * 
      * @return String The result of the action.
      */

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearch.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearch.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearch.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearch.java Fri May  8 03:10:24 2009
@@ -41,19 +41,33 @@
 public class MediaFileSearch extends MediaFileBase {
     private static Log log = LogFactory.getLog(MediaFileSearch.class);
 
-    private static final List<String> fileTypes;
-    private static final List<KeyValueObject> sizeFilterTypes;
-    private static final List<KeyValueObject> sizeUnits;
-    private static final List<KeyValueObject> sortOptions;
+    // Search criteria - drop-down for file type 
+    private static final List<String> FILE_TYPES;
+
+    // Search criteria - drop-down for size filter
+    private static final List<KeyValueObject> SIZE_FILTER_TYPES;
+
+    // Search criteria - drop-down for size unit
+    private static final List<KeyValueObject> SIZE_UNITS;
+
+    // Sort options for search results.
+    private static final List<KeyValueObject> SORT_OPTIONS;
     
+    // Pager for displaying search results.
     private MediaFilePager pager;
 
+    // Path of new directory to be created.
     private String newDirectoryPath;
     
     static {
-        fileTypes = Arrays.asList("", "Audio", "Video", "Image", "Others");
+    	/**
+    	 * Initialize drop-down values.
+    	 * 
+    	 */
+    	
+    	FILE_TYPES = Arrays.asList("", "Audio", "Video", "Image", "Others");
         
-        sizeFilterTypes = Arrays.asList(
+    	SIZE_FILTER_TYPES = Arrays.asList(
         		new KeyValueObject(0, "greater than"),
         		new KeyValueObject(1, "greater than or equal to"),
         		new KeyValueObject(2, "equal to"),
@@ -61,13 +75,13 @@
         		new KeyValueObject(4, "less than")
         		);
 
-        sizeUnits = Arrays.asList(
+    	SIZE_UNITS = Arrays.asList(
         		new KeyValueObject(0, "bytes"),
         		new KeyValueObject(1, "kilobytes"),
         		new KeyValueObject(2, "megabytes")
         		);
         
-        sortOptions = Arrays.asList(
+    	SORT_OPTIONS = Arrays.asList(
         		new KeyValueObject(0, "Name"),
         		new KeyValueObject(1, "Date Uploaded"),
         		new KeyValueObject(2, "Type")
@@ -82,6 +96,9 @@
         this.pageTitle = "mediaFile.search.title";
     }
     
+    /**
+     * Prepares search action
+     */
     public void myPrepare() {
     	refreshAllDirectories();
     }
@@ -133,26 +150,46 @@
 		return INPUT;
     }
     
+    /**
+     * Delete the selected media file.
+     * 
+     */
     public String delete() {
     	doDeleteMediaFile();
     	return search();
     }
     
+    /**
+     * Include selected media file in public gallery.
+     * 
+     */
     public String includeInGallery() {
     	doIncludeMediaFileInGallery();
     	return search();
     }
 
+    /**
+     * Delete selected media files.
+     * 
+     */
     public String deleteSelected() {
     	doDeleteSelected();
     	return search();
     }
     
+    /**
+     * Move selected media files to a directory.
+     * 
+     */
     public String moveSelected() {
         doMoveSelected();
     	return search();
     }
     
+    /**
+     * Creates a directory by its path
+     * 
+     */
     public String createDirByPath() {
     	boolean dirCreated = false;
 		if (StringUtils.isEmpty(this.newDirectoryPath)) {
@@ -184,6 +221,9 @@
     	return search();
     }
     
+    /**
+     * Validates search input
+     */
     public boolean myValidate() {
         if (StringUtils.isEmpty(bean.getName())
         	&& StringUtils.isEmpty(bean.getTags())
@@ -204,19 +244,19 @@
     }
     
     public List<String> getFileTypes() {
-    	return fileTypes;
+    	return FILE_TYPES;
     }
     
     public List<KeyValueObject> getSizeFilterTypes() {
-    	return sizeFilterTypes;
+    	return SIZE_FILTER_TYPES;
     }
     
     public List<KeyValueObject> getSizeUnits() {
-    	return sizeUnits;
+    	return SIZE_UNITS;
     }
 
     public List<KeyValueObject> getSortOptions() {
-    	return sortOptions;
+    	return SORT_OPTIONS;
     }
 
     public MediaFilePager getPager() {

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearchBean.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearchBean.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearchBean.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileSearchBean.java Fri May  8 03:10:24 2009
@@ -33,13 +33,28 @@
 public class MediaFileSearchBean {
 	public static int PAGE_SIZE = 10;
 
+	// Media file name as search criteria
 	String name;
+
+	// Media file type as search criteria
 	String type;
+
+	// Type of size filter as search criteria
 	int sizeFilterType;
+
+	// Size of file as search criteria
 	long size;
+
+	// Size unit
 	int sizeUnit;
+
+	// Tags as search criteria
 	String tags;
+
+	// Page number of results
 	int pageNum = 0;
+
+	// Sort option for search results
 	int sortOption;
 
 	public String getName() {
@@ -93,6 +108,10 @@
 		this.sortOption = sortOption;
 	}
 
+	/**
+	 * Copies data from this bean to media file filter object.
+	 * 
+	 */
 	public void copyTo(MediaFileFilter dataHolder) {
     	dataHolder.setName(this.name);
     	

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java Fri May  8 03:10:24 2009
@@ -40,16 +40,17 @@
 import org.apache.struts2.interceptor.validation.SkipValidation;
 
 /**
- * Adds a new media file.
+ * View media files.
  */
 @SuppressWarnings("serial")
 public class MediaFileView extends MediaFileBase {
     private static Log log = LogFactory.getLog(MediaFileView.class);
     
-    private static final List<KeyValueObject> sortOptions;
+    // Drop-down values for sorting media files.
+    private static final List<KeyValueObject> SORT_OPTIONS;
 
     static {
-        sortOptions = Arrays.asList(
+    	SORT_OPTIONS = Arrays.asList(
         		new KeyValueObject("", ""),
         		new KeyValueObject("name", "Name"),
         		new KeyValueObject("date_uploaded", "Date Uploaded"),
@@ -74,10 +75,16 @@
         this.pageTitle = "mediaFile.view.title";
     }
     
+    /**
+     * Prepares view action
+     */
     public void myPrepare() {
     	refreshAllDirectories();
     }
 
+    /**
+     * Create a new directory by name under current directory
+     */
     public String createNewDirectory() {
     	boolean dirCreated = false;
 		if (StringUtils.isEmpty(this.newDirectoryName)) {
@@ -121,7 +128,8 @@
     }
     
     /**
-     * Show form for adding a new media file.
+     * Fetches and displays list of media file for the given directory.
+     * The directory could be chosen by ID or path.
      * 
      * @return String The result of the action.
      */
@@ -174,6 +182,10 @@
 		return SUCCESS;
     }
     
+    /**
+     * Returns the hierarchy of the current directory. This is useful in
+     * displaying path information as breadcrumb.
+     */
     public List<KeyValueObject> getCurrentDirectoryHierarchy() {
     	List<KeyValueObject> directoryHierarchy = new ArrayList<KeyValueObject>();
 
@@ -190,21 +202,37 @@
     	return directoryHierarchy;
     }
     
+    /**
+     * Delete selected media files.
+     * 
+     */
     public String deleteSelected() {
     	doDeleteSelected();
     	return execute();
     }
     
+    /**
+     * Delete selected media file
+     * 
+     */
     public String delete() {
     	doDeleteMediaFile();
     	return execute();
     }
     
+    /**
+     * Include selected media file in gallery
+     * 
+     */
     public String includeInGallery() {
     	doIncludeMediaFileInGallery();
     	return execute();
     }
 
+    /**
+     * Move selected media files to a different directory
+     * 
+     */
     public String moveSelected() {
         doMoveSelected();
     	return execute();
@@ -270,7 +298,7 @@
 	}
 
     public List<KeyValueObject> getSortOptions() {
-    	return sortOptions;
+    	return SORT_OPTIONS;
     }
 
 }

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/pagers/MediaFilePager.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/pagers/MediaFilePager.java?rev=772831&r1=772830&r2=772831&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/pagers/MediaFilePager.java (original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/pagers/MediaFilePager.java Fri May  8 03:10:24 2009
@@ -1,21 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
 package org.apache.roller.weblogger.ui.struts2.pagers;
 
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.pojos.MediaFile;
 
+/**
+ * A pager implementation for a collection of media files.
+ *
+ */
 public class MediaFilePager {
-    private static final Log log = LogFactory.getLog(MediaFilePager.class);
     
     // the collection for the pager
     private final List<MediaFile> items;
     
-    // what page we are on
+    // What page we are on
     private final int pageNum;
     
-    // are there more items?
+    // Are there more items?
     private final boolean moreItems;
     
     public MediaFilePager(int page, List<MediaFile> mediaFiles, boolean hasMore) {
@@ -32,14 +51,26 @@
         return moreItems;
     }
 
+    /**
+     * Indicates whether there are more than one page of item.
+     * 
+     */
     public boolean isJustOnePage() {
     	return (pageNum == 0 && !moreItems);
     }
     
+    /**
+     * Has previous page?
+     * 
+     */
     public boolean hasPrevious() {
     	return (pageNum > 0);
     }
     
+    /**
+     * Has next page?
+     * 
+     */
     public boolean hasNext() {
     	return this.moreItems;
     }



Mime
View raw message