Package org.jresearch.gossip.dao

Examples of org.jresearch.gossip.dao.ForumDAO


   * @return DOCUMENT ME!
   */
  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    ForumDAO dao = ForumDAO.getInstance();
    ProcessGroupForm pgForm = (ProcessGroupForm) form;
    try {
     
      Group group = dao.getGroupInfo(pgForm.getGid());
      request.setAttribute("group_name", group.getName());
      request.setAttribute("group_sort", group.getSort());
      request.setAttribute("gid", pgForm.getGid());
    } catch (SQLException sqle) {
      getServlet().log("Connection.process", sqle);
View Full Code Here


    /* (non-Javadoc)
     * @see org.jresearch.gossip.actions.BaseAction#process(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    protected ActionForward process(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws JGossipException {
        ForumDAO dao = ForumDAO.getInstance();
        try {
            dao.clearLog();
            request.getSession().removeAttribute(IConst.SESSION.SEARCH_CRITERIA_LOG);
            log(request,"logs.LOG30");
        } catch (SQLException e) {
            throw new SystemException(e);
        }
View Full Code Here

     *      javax.servlet.http.HttpServletResponse)
     */
    protected ActionForward process(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws JGossipException {
        ForumDAO dao = ForumDAO.getInstance();
        HttpSession session = request.getSession();
        ListForm lForm = (ListForm) form;
        try {
            RecordsData records = new RecordsData();

            User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
            records.setBlockSize((null != user) ? user.getSettings()
                    .getMes_per_page() : 25);
            if (session.getAttribute(IConst.SESSION.SEARCH_CRITERIA_LOG) == null) {
                session.setAttribute(IConst.SESSION.SEARCH_CRITERIA_LOG,
                        new LogSearchCriteria());
            }
            LogSearchCriteria criteria = (LogSearchCriteria) session
                    .getAttribute(IConst.SESSION.SEARCH_CRITERIA_LOG);
            int block = Integer.parseInt(lForm.getBlock());
            dao.fillLogEntryList(criteria, records, block);
            request.setAttribute(IConst.REQUEST.RECORDS_DATA, records);
            ArrayIterator it = new ArrayIterator();
            it.setArray(JGossipLog.PRIORITIES);
            request.setAttribute("log_level", it);
        } catch (SQLException sqle) {
View Full Code Here

            HttpServletRequest request, HttpServletResponse response)
            throws JGossipException {
        if (!Configurator.getInstance().getBoolean(IConst.CONFIG.ENABLE_AVATAR)) { return (mapping
                .findForward(IConst.TOKEN.DENIED)); }
        ProcessUserForm puForm = (ProcessUserForm) form;
        ForumDAO dao = ForumDAO.getInstance();
        response.setContentType(IConst.JSP.JPG_CONTENT_TYPE);
        response.setHeader("Pragma", "no-cache");
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);
        try {
            ServletOutputStream out = response.getOutputStream();
            byte[] data = dao.getAvatar(puForm.getUid());
            out.write(data);
        } catch (IOException e) {
            throw new SystemException(e);
        }
        return null;
View Full Code Here

        if (!Configurator.getInstance().getBoolean(IConst.CONFIG.ENABLE_AVATAR)) { return (mapping
                .findForward(IConst.TOKEN.DENIED)); }

        HttpSession session = request.getSession();
        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        ForumDAO dao = ForumDAO.getInstance();
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            BufferedImage image=getImage(form);
            if(image==null){
                throw new SystemException("Unable to parse image");
            }
            PictureGenerator.getInstance().prepareImage(image, buffer);
            byte[] data = buffer.toByteArray();
            dao.saveAvatar(user, data);
        } catch (Exception e) {
            super.setStatusMessage(request,"errors.general","<br>"+e.getMessage());
            return mapping.getInputForward();
        }
        return (mapping.findForward(IConst.TOKEN.PAGE));
View Full Code Here

        session.setAttribute(IConst.SESSION.TIME_ZONE, IConst.VALUES.GMT);
        session.setAttribute(IConst.SESSION.LAST_INTIME, new HashMap());

        ServletContext app = session.getServletContext();

        ForumDAO forumdao = ForumDAO.getInstance();
        HashMap SkinParams = new HashMap();

        try {

            forumdao.loadSkinParams(IConst.CONFIG.DEFAULT_SKIN_ID, SkinParams);
        } catch (SQLException sqle) {
            //TODO load default params
            sqle.printStackTrace();
        }
View Full Code Here

     */
    public ActionForward process(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {

        ForumDAO dao = ForumDAO.getInstance();
        UserDAO userdao = UserDAO.getInstance();
        MessageResources messages = getResources(request);
        HttpSession session = request.getSession();

        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);

        try {
           
            ArrayList groups = dao.getGroups(user.getStatus(), messages);

            for (int i = 0; i < groups.size(); i++) {
                ArrayList forums = ((Group) groups.get(i)).getForums();

                for (int j = 0; j < forums.size(); j++) {
View Full Code Here

     * @throws Exception DOCUMENT ME!
     */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {
        ForumDAO dao = ForumDAO.getInstance();
        HttpSession session = request.getSession();
        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        List updatedTopics = null;
        ActionForward forward = null;
        String fid =  ((ProcessForumForm) form).getFid();

        try {
           

            if (fid==null||fid.equals("")) {
                updatedTopics = dao.getUpdatedTopics(user);
                forward = mapping.findForward(IConst.TOKEN.WELCOME);
            } else {
                updatedTopics = dao.getUpdatedTopics(user, Integer.parseInt(fid));
                forward = new ActionForward("/ShowForum.do?fid=" + fid, true);
            }

            Iterator it = updatedTopics.iterator();

            HashMap lastIntimeMap = (HashMap) session.getAttribute(IConst.SESSION.LAST_INTIME);
            Date now = dao.now();

            while (it.hasNext()) {
                updateLastVisitTime(lastIntimeMap, (String) it.next(), now);
            }
        } catch (SQLException sqle) {
View Full Code Here

     */
    public ActionForward process(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {
        UserDAO userdao = UserDAO.getInstance();
        ForumDAO forumdao = ForumDAO.getInstance();
        ProcessUserForm puForm = (ProcessUserForm) form;
        try {

            User userToShow = userdao.getUserInfo(puForm.getUid());
            request.setAttribute(IConst.REQUEST.USER_TO_SHOW, userToShow);

            ArrayList userModForums = forumdao.getUserModForums(userToShow.getName());

            if (userModForums.size() > 0) {
                request.setAttribute(IConst.REQUEST.USER_MOD_FORUMS,
                    userModForums);
            }

            ArrayList forumsForMod = forumdao.getForumsForMod();

            request.setAttribute(IConst.REQUEST.FORUMS_FOR_MOD, forumsForMod);
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
            throw new SystemException(sqle);
View Full Code Here

     * @see org.jresearch.gossip.actions.BaseAction#process(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    public ActionForward process(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {
        ForumDAO dao = ForumDAO.getInstance();

        try {
           

            dao.updateConstants(((DynaActionForm) form).getMap());
            Configurator.getInstance().reload(getServlet().getServletContext());
            if(Configurator.getInstance().getBoolean(IConst.CONFIG.ENABLE_FILE_UPLOAD)){
                FileDbEnv.load();
            }
            MailProcessor._mailSession = null;
View Full Code Here

TOP

Related Classes of org.jresearch.gossip.dao.ForumDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.