001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/service/impl/CategoryServiceImplDefault.java,v 1.14 2007/10/09 11:09:21 lexuanttkhtn Exp $
003: * $Author: lexuanttkhtn $
004: * $Revision: 1.14 $
005: * $Date: 2007/10/09 11:09:21 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding mvnForum MUST remain
012: * intact in the scripts and in the outputted HTML.
013: * The "powered by" text/logo with a link back to
014: * http://www.mvnForum.com and http://www.MyVietnam.net in
015: * the footer of the pages MUST remain visible when the pages
016: * are viewed on the internet or intranet.
017: *
018: * This program is free software; you can redistribute it and/or modify
019: * it under the terms of the GNU General Public License as published by
020: * the Free Software Foundation; either version 2 of the License, or
021: * any later version.
022: *
023: * This program is distributed in the hope that it will be useful,
024: * but WITHOUT ANY WARRANTY; without even the implied warranty of
025: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
026: * GNU General Public License for more details.
027: *
028: * You should have received a copy of the GNU General Public License
029: * along with this program; if not, write to the Free Software
030: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
031: *
032: * Support can be obtained from support forums at:
033: * http://www.mvnForum.com/mvnforum/index
034: *
035: * Correspondence and Marketing Questions can be sent to:
036: * info at MyVietnam net
037: *
038: * @author: Phuong, Pham Dinh Duy
039: */
040: package com.mvnforum.service.impl;
041:
042: import net.myvietnam.mvncore.exception.DatabaseException;
043: import net.myvietnam.mvncore.util.AssertionUtil;
044: import net.myvietnam.mvncore.web.GenericRequest;
045: import net.myvietnam.mvncore.web.GenericResponse;
046:
047: import com.mvnforum.auth.AuthenticationException;
048: import com.mvnforum.categorytree.CategoryTreeListener;
049: import com.mvnforum.categorytree.impl.CategorySelector;
050: import com.mvnforum.categorytree.impl.CategoryTreeListenerImpl;
051: import com.mvnforum.categorytree.impl.ListAllForumImpl;
052: import com.mvnforum.categorytree.impl.ListForums;
053: import com.mvnforum.categorytree.impl.ModcpImpl;
054: import com.mvnforum.categorytree.impl.RSSImpl;
055: import com.mvnforum.categorytree.impl.ViewMemberPermissionsImpl;
056: import com.mvnforum.db.CategoryBean;
057: import com.mvnforum.db.ForumBean;
058: import com.mvnforum.service.CategoryService;
059:
060: public class CategoryServiceImplDefault implements CategoryService {
061:
062: private static int count;
063:
064: public CategoryServiceImplDefault() {
065: count++;
066: AssertionUtil.doAssert(count == 1,
067: "Assertion: Must have only one instance.");
068: }
069:
070: public CategoryTreeListener getManagementCategoryTree(
071: GenericRequest request, GenericResponse response)
072: throws AuthenticationException, DatabaseException {
073:
074: return new CategoryTreeListenerImpl(request, response);
075: }
076:
077: public CategoryTreeListener getManagementCategorySelector(
078: GenericRequest request, GenericResponse response)
079: throws AuthenticationException, DatabaseException {
080:
081: return new CategorySelector(request, response);
082: }
083:
084: public CategoryTreeListener getManagementListAllForum(
085: GenericRequest request, GenericResponse response)
086: throws AuthenticationException, DatabaseException {
087:
088: return new ListAllForumImpl(request, response);
089: }
090:
091: public CategoryTreeListener getManagementCategorySelector(
092: GenericRequest request, GenericResponse response,
093: String page) throws AuthenticationException,
094: DatabaseException {
095:
096: return new CategorySelector(request, response, page);
097: }
098:
099: public CategoryTreeListener getManagementCategorySelector(
100: GenericRequest request, GenericResponse response,
101: String page, int forum, int category)
102: throws AuthenticationException, DatabaseException {
103:
104: return new CategorySelector(request, response, page, forum,
105: category);
106: }
107:
108: public CategoryTreeListener getManagementCategorySelector(
109: GenericRequest request, GenericResponse response,
110: String page, int forumID) throws AuthenticationException,
111: DatabaseException {
112:
113: return new CategorySelector(request, response, page, forumID);
114: }
115:
116: public CategoryTreeListener getManagementCategorySelector(
117: GenericRequest request, GenericResponse response,
118: boolean addForum, String selectName)
119: throws AuthenticationException, DatabaseException {
120:
121: return new CategorySelector(request, response, addForum,
122: selectName);
123: }
124:
125: public CategoryTreeListener getManagementCategorySelector(
126: GenericRequest request, GenericResponse response,
127: ForumBean forumBean) throws AuthenticationException,
128: DatabaseException {
129:
130: return new CategorySelector(request, response, forumBean);
131: }
132:
133: public ViewMemberPermissionsImpl getManagementViewMemberPermissions(
134: GenericRequest request) throws AuthenticationException,
135: DatabaseException {
136:
137: return new ViewMemberPermissionsImpl(request);
138: }
139:
140: public CategoryTreeListener getManagementRSS(
141: GenericRequest request, GenericResponse response,
142: String sort, String order) throws DatabaseException,
143: AuthenticationException {
144:
145: return new RSSImpl(request, response, sort, order);
146: }
147:
148: public CategoryTreeListener getManagementModcp(
149: GenericRequest request, GenericResponse response)
150: throws DatabaseException, AuthenticationException {
151:
152: return new ModcpImpl(request, response);
153: }
154:
155: public CategoryTreeListener getManagementListForums(
156: GenericRequest request, GenericResponse response,
157: CategoryBean rootCategory, boolean otherInvisible,
158: boolean show_sub_category) throws DatabaseException,
159: AuthenticationException {
160:
161: return new ListForums(request, response);
162: }
163:
164: }
|