*/
package mircoders.localizer.basic;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
import mir.entity.Entity;
-import mir.session.*;
+import mir.session.Request;
+import mir.session.Response;
+import mir.session.Session;
+import mir.session.SessionExc;
+import mir.session.SessionFailure;
+import mir.session.ValidationHelper;
import mir.util.EntityUtility;
import mircoders.entity.EntityComment;
-import mircoders.entity.EntityContent;
import mircoders.global.MirGlobal;
import mircoders.media.MediaUploadProcessor;
-import mircoders.module.ModuleComment;
import mircoders.module.ModuleCommentStatus;
import mircoders.module.ModuleMediafolder;
-import mircoders.storage.*;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import mircoders.storage.DatabaseComment;
+import mircoders.storage.DatabaseCommentToMedia;
+import mircoders.storage.DatabaseContent;
/**
- *
- * <p>Title: Experimental session handler for comment postings </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: </p>
+ * Session handler for comment postings
+ *
* @author Zapata
- * @version 1.0
*/
public class MirBasicCommentPostingHandler extends MirBasicPostingSessionHandler {
- protected ModuleComment commentModule = new ModuleComment();
+ protected DatabaseComment commentDatabase = DatabaseComment.getInstance();
protected DatabaseCommentToMedia commentToMedia = DatabaseCommentToMedia.getInstance();
throw new SessionExc("initializeSession: article id not set!");
aSession.setAttribute("to_media", articleId);
- };
+ }
public void finalizeComment(Request aRequest, Session aSession, EntityComment aComment) throws SessionExc, SessionFailure {
try {
String id;
Map values = getIntersectingValues(aRequest, DatabaseComment.getInstance());
- EntityComment comment = (EntityComment) commentModule.createNew();
+ EntityComment comment = (EntityComment) commentDatabase.createNewEntity();
comment.setFieldValues(values);
finalizeComment(aRequest, aSession, comment);
id = comment.insert();
}
DatabaseContent.getInstance().setUnproduced("id=" + comment.getFieldValue("to_media"));
logger.info("Comment posted");
- };
+ }
protected static class DuplicateCommentExc extends SessionExc {
public DuplicateCommentExc(String aMessage) {