001: /*
002: * File : $Source: /usr/local/cvs/alkacon/com.alkacon.opencms.newsletter/src/com/alkacon/opencms/newsletter/admin/CmsNotSubscriberMailinglistsList.java,v $
003: * Date : $Date: 2007-11-30 11:57:27 $
004: * Version: $Revision: 1.6 $
005: *
006: * This file is part of the Alkacon OpenCms Add-On Module Package
007: *
008: * Copyright (c) 2007 Alkacon Software GmbH (http://www.alkacon.com)
009: *
010: * The Alkacon OpenCms Add-On Module Package is free software:
011: * you can redistribute it and/or modify
012: * it under the terms of the GNU General Public License as published by
013: * the Free Software Foundation, either version 3 of the License, or
014: * (at your option) any later version.
015: *
016: * The Alkacon OpenCms Add-On Module Package is distributed
017: * in the hope that it will be useful,
018: * but WITHOUT ANY WARRANTY; without even the implied warranty of
019: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
020: * GNU General Public License for more details.
021: *
022: * You should have received a copy of the GNU General Public License
023: * along with the Alkacon OpenCms Add-On Module Package.
024: * If not, see http://www.gnu.org/licenses/.
025: *
026: * For further information about Alkacon Software GmbH, please see the
027: * company website: http://www.alkacon.com.
028: *
029: * For further information about OpenCms, please see the
030: * project website: http://www.opencms.org.
031: */
032:
033: package com.alkacon.opencms.newsletter.admin;
034:
035: import org.opencms.jsp.CmsJspActionElement;
036: import org.opencms.util.CmsStringUtil;
037: import org.opencms.workplace.list.CmsListColumnDefinition;
038: import org.opencms.workplace.list.CmsListDefaultAction;
039: import org.opencms.workplace.list.CmsListMetadata;
040: import org.opencms.workplace.list.CmsListMultiAction;
041: import org.opencms.workplace.list.I_CmsListDirectAction;
042:
043: import javax.servlet.http.HttpServletRequest;
044: import javax.servlet.http.HttpServletResponse;
045: import javax.servlet.jsp.PageContext;
046:
047: /**
048: * List of mailings lists where the user is not subscribed to.<p>
049: *
050: * @author Michael Moossen
051: * @author Andreas Zahner
052: *
053: * @version $Revision: 1.6 $
054: *
055: * @since 7.0.3
056: */
057: public class CmsNotSubscriberMailinglistsList extends
058: org.opencms.workplace.tools.accounts.CmsNotUserGroupsList {
059:
060: /**
061: * Public constructor.<p>
062: *
063: * @param jsp an initialized JSP action element
064: */
065: public CmsNotSubscriberMailinglistsList(CmsJspActionElement jsp) {
066:
067: super (jsp, LIST_ID + "l");
068: getList()
069: .setName(
070: Messages
071: .get()
072: .container(
073: Messages.GUI_NOTSUBSCRIBERMAILINGLISTS_LIST_NAME_0));
074: }
075:
076: /**
077: * Public constructor with JSP variables.<p>
078: *
079: * @param context the JSP page context
080: * @param req the JSP request
081: * @param res the JSP response
082: */
083: public CmsNotSubscriberMailinglistsList(PageContext context,
084: HttpServletRequest req, HttpServletResponse res) {
085:
086: this (new CmsJspActionElement(context, req, res));
087: }
088:
089: /**
090: * @see org.opencms.workplace.CmsWorkplace#initMessages()
091: */
092: protected void initMessages() {
093:
094: // add specific dialog resource bundle
095: addMessages(Messages.get().getBundleName());
096: // add default resource bundles
097: super .initMessages();
098: }
099:
100: /**
101: * @see org.opencms.workplace.tools.accounts.A_CmsUserGroupsList#setColumns(org.opencms.workplace.list.CmsListMetadata)
102: */
103: protected void setColumns(CmsListMetadata metadata) {
104:
105: super .setColumns(metadata);
106:
107: CmsListColumnDefinition iconCol = metadata
108: .getColumnDefinition(LIST_COLUMN_ICON);
109: iconCol.setName(Messages.get().container(
110: Messages.GUI_MAILINGLISTS_LIST_COLS_ICON_0));
111: iconCol.setHelpText(Messages.get().container(
112: Messages.GUI_MAILINGLISTS_LIST_COLS_ICON_HELP_0));
113: I_CmsListDirectAction iconAction = iconCol
114: .getDirectAction(LIST_ACTION_ICON);
115: iconAction.setName(Messages.get().container(
116: Messages.GUI_MAILINGLISTS_LIST_AVAILABLE_NAME_0));
117: iconAction.setHelpText(Messages.get().container(
118: Messages.GUI_MAILINGLISTS_LIST_AVAILABLE_HELP_0));
119: iconAction
120: .setIconPath(CmsSubscriberMailinglistsList.PATH_BUTTONS
121: + "mailinglist.png");
122:
123: CmsListColumnDefinition displayCol = metadata
124: .getColumnDefinition(LIST_COLUMN_DISPLAY);
125: displayCol.setName(Messages.get().container(
126: Messages.GUI_MAILINGLISTS_LIST_COLS_NAME_0));
127: CmsListDefaultAction addAction = displayCol
128: .getDefaultAction(LIST_DEFACTION_ADD);
129: addAction.setName(Messages.get().container(
130: Messages.GUI_MAILINGLISTS_LIST_DEFACTION_ADD_NAME_0));
131: addAction.setHelpText(Messages.get().container(
132: Messages.GUI_MAILINGLISTS_LIST_DEFACTION_ADD_HELP_0));
133:
134: CmsListColumnDefinition descCol = metadata
135: .getColumnDefinition(LIST_COLUMN_DESCRIPTION);
136: descCol.setName(Messages.get().container(
137: Messages.GUI_MAILINGLISTS_LIST_COLS_DESCRIPTION_0));
138:
139: CmsListColumnDefinition stateCol = metadata
140: .getColumnDefinition(LIST_COLUMN_STATE);
141: stateCol.setName(Messages.get().container(
142: Messages.GUI_MAILINGLISTS_LIST_COLS_STATE_0));
143: stateCol.setHelpText(Messages.get().container(
144: Messages.GUI_MAILINGLISTS_LIST_COLS_STATE_HELP_0));
145: I_CmsListDirectAction dirStateAction = stateCol
146: .getDirectAction(LIST_ACTION_ADD);
147: dirStateAction.setName(Messages.get().container(
148: Messages.GUI_MAILINGLISTS_LIST_DEFACTION_ADD_NAME_0));
149: dirStateAction.setHelpText(Messages.get().container(
150: Messages.GUI_MAILINGLISTS_LIST_DEFACTION_ADD_HELP_0));
151: }
152:
153: /**
154: * @see org.opencms.workplace.tools.accounts.A_CmsUserGroupsList#setIndependentActions(org.opencms.workplace.list.CmsListMetadata)
155: */
156: protected void setIndependentActions(CmsListMetadata metadata) {
157:
158: // no independent actions wanted
159: }
160:
161: /**
162: * @see org.opencms.workplace.tools.accounts.CmsNotUserGroupsList#setMultiActions(org.opencms.workplace.list.CmsListMetadata)
163: */
164: protected void setMultiActions(CmsListMetadata metadata) {
165:
166: super .setMultiActions(metadata);
167:
168: CmsListMultiAction addMultiAction = metadata
169: .getMultiAction(LIST_MACTION_ADD);
170: addMultiAction.setName(Messages.get().container(
171: Messages.GUI_MAILINGLISTS_LIST_MACTION_ADD_NAME_0));
172: addMultiAction.setHelpText(Messages.get().container(
173: Messages.GUI_MAILINGLISTS_LIST_MACTION_ADD_HELP_0));
174: addMultiAction.setConfirmationMessage(Messages.get().container(
175: Messages.GUI_MAILINGLISTS_LIST_MACTION_ADD_CONF_0));
176: }
177:
178: /**
179: * @see org.opencms.workplace.tools.accounts.A_CmsUserGroupsList#validateParamaters()
180: */
181: protected void validateParamaters() throws Exception {
182:
183: super .validateParamaters();
184: // this is to prevent the switch to the root ou
185: // if the oufqn param get lost (by reloading for example)
186: if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamOufqn())) {
187: throw new Exception();
188: }
189: }
190: }
|