+ public void attach(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
+ {
+ String mediaIdParam = aRequest.getParameter("mid");
+ String commentId = aRequest.getParameter("commentid");
+
+ if (commentId == null || mediaIdParam==null) throw new ServletModuleExc("smod comment :: attach :: commentid/mid missing");
+
+ try {
+ EntityComment comment = (EntityComment) mainModule.getById(commentId);
+ comment.attach(mediaIdParam);
+ }
+ catch(Throwable e) {
+ throw new ServletModuleFailure(e);
+ }
+
+ logAdminUsage(aRequest, commentId, "media " + mediaIdParam + " attached");
+
+ editObject(aRequest, aResponse, commentId);
+ }
+
+ public void dettach(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
+ {
+ String commentId = aRequest.getParameter("commentid");
+ String midParam = aRequest.getParameter("mid");
+ if (commentId == null)
+ throw new ServletModuleExc("smod comment :: dettach :: commentid missing");
+ if (midParam == null)
+ throw new ServletModuleExc("smod comment :: dettach :: mid missing");
+
+ try {
+ EntityComment comment = (EntityComment)mainModule.getById(commentId);
+ comment.dettach(commentId, midParam);
+ }
+ catch(Throwable e) {
+ throw new ServletModuleFailure(e);
+ }
+
+ logAdminUsage(aRequest, commentId, "media " + midParam + " deattached");
+
+ editObject(aRequest, aResponse, commentId);
+ }
+