001: /*
002: * File : $Source: /usr/local/cvs/alkacon/com.alkacon.opencms.newsletter/src/com/alkacon/opencms/newsletter/admin/CmsNotMailinglistSubscribersList.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.CmsListDirectAction;
040: import org.opencms.workplace.list.CmsListMetadata;
041: import org.opencms.workplace.list.CmsListMultiAction;
042: import org.opencms.workplace.list.I_CmsListDirectAction;
043:
044: import javax.servlet.http.HttpServletRequest;
045: import javax.servlet.http.HttpServletResponse;
046: import javax.servlet.jsp.PageContext;
047:
048: /**
049: * Not mailing list subscribers view.<p>
050: *
051: * @author Michael Moossen
052: * @author Andreas Zahner
053: *
054: * @version $Revision: 1.6 $
055: *
056: * @since 7.0.3
057: */
058: public class CmsNotMailinglistSubscribersList extends
059: org.opencms.workplace.tools.accounts.CmsNotGroupUsersList {
060:
061: /**
062: * Public constructor.<p>
063: *
064: * @param jsp an initialized JSP action element
065: */
066: public CmsNotMailinglistSubscribersList(CmsJspActionElement jsp) {
067:
068: super (jsp, LIST_ID + "l");
069: getList()
070: .setName(
071: Messages
072: .get()
073: .container(
074: Messages.GUI_NOTMAILINGLISTSUBSCRIBERS_LIST_NAME_0));
075: }
076:
077: /**
078: * Public constructor with JSP variables.<p>
079: *
080: * @param context the JSP page context
081: * @param req the JSP request
082: * @param res the JSP response
083: */
084: public CmsNotMailinglistSubscribersList(PageContext context,
085: HttpServletRequest req, HttpServletResponse res) {
086:
087: this (new CmsJspActionElement(context, req, res));
088: }
089:
090: /**
091: * @see org.opencms.workplace.list.A_CmsListDialog#initializeDetail(java.lang.String)
092: */
093: protected void initializeDetail(String detailId) {
094:
095: super .initializeDetail(detailId);
096: if (detailId.equals(LIST_DETAIL_OTHEROU)) {
097: getList().getMetadata().getColumnDefinition(
098: LIST_COLUMN_ORGUNIT).setVisible(false);
099: getList().getMetadata().getColumnDefinition(
100: LIST_COLUMN_ORGUNIT).setPrintable(false);
101: }
102: }
103:
104: /**
105: * @see org.opencms.workplace.CmsWorkplace#initMessages()
106: */
107: protected void initMessages() {
108:
109: // add specific dialog resource bundle
110: addMessages(Messages.get().getBundleName());
111: // add default resource bundles
112: super .initMessages();
113: }
114:
115: /**
116: * @see org.opencms.workplace.tools.accounts.A_CmsGroupUsersList#setColumns(org.opencms.workplace.list.CmsListMetadata)
117: */
118: protected void setColumns(CmsListMetadata metadata) {
119:
120: super .setColumns(metadata);
121:
122: CmsListColumnDefinition iconCol = metadata
123: .getColumnDefinition(LIST_COLUMN_ICON);
124: iconCol.setName(Messages.get().container(
125: Messages.GUI_SUBSCRIBERS_LIST_COLS_ICON_0));
126: iconCol.setHelpText(Messages.get().container(
127: Messages.GUI_SUBSCRIBERS_LIST_COLS_ICON_HELP_0));
128:
129: I_CmsListDirectAction iconAction = iconCol
130: .getDirectAction(LIST_ACTION_ICON);
131: iconAction.setName(Messages.get().container(
132: Messages.GUI_SUBSCRIBERS_LIST_AVAILABLE_NAME_0));
133: iconAction.setHelpText(Messages.get().container(
134: Messages.GUI_SUBSCRIBERS_LIST_AVAILABLE_HELP_0));
135: iconAction
136: .setIconPath(CmsSubscriberMailinglistsList.PATH_BUTTONS
137: + "subscriber.png");
138:
139: CmsListColumnDefinition nameCol = metadata
140: .getColumnDefinition(LIST_COLUMN_NAME);
141: nameCol.setName(Messages.get().container(
142: Messages.GUI_SUBSCRIBERS_LIST_COLS_EMAIL_0));
143: nameCol.setWidth("100%");
144:
145: CmsListDefaultAction addAction = nameCol
146: .getDefaultAction(LIST_DEFACTION_ADD);
147: addAction.setName(Messages.get().container(
148: Messages.GUI_SUBSCRIBERS_LIST_DEFACTION_ADD_NAME_0));
149: addAction.setHelpText(Messages.get().container(
150: Messages.GUI_SUBSCRIBERS_LIST_DEFACTION_ADD_HELP_0));
151:
152: I_CmsListDirectAction stateAction = metadata
153: .getColumnDefinition(LIST_COLUMN_STATE)
154: .getDirectAction(LIST_ACTION_ADD);
155: stateAction.setName(Messages.get().container(
156: Messages.GUI_SUBSCRIBERS_LIST_DEFACTION_ADD_NAME_0));
157: stateAction.setHelpText(Messages.get().container(
158: Messages.GUI_SUBSCRIBERS_LIST_DEFACTION_ADD_HELP_0));
159:
160: metadata.getColumnDefinition(LIST_COLUMN_FULLNAME).setVisible(
161: false);
162: }
163:
164: /**
165: * @see org.opencms.workplace.tools.accounts.CmsNotGroupUsersList#setIconAction(org.opencms.workplace.list.CmsListColumnDefinition)
166: */
167: protected void setIconAction(CmsListColumnDefinition iconCol) {
168:
169: CmsListDirectAction iconAction = new CmsListDefaultAction(
170: LIST_ACTION_ICON);
171: iconAction.setEnabled(false);
172: iconCol.addDirectAction(iconAction);
173: }
174:
175: /**
176: * @see org.opencms.workplace.tools.accounts.CmsNotGroupUsersList#setIndependentActions(org.opencms.workplace.list.CmsListMetadata)
177: */
178: protected void setIndependentActions(CmsListMetadata metadata) {
179:
180: // no independent actions needed
181: }
182:
183: /**
184: * @see org.opencms.workplace.tools.accounts.CmsNotGroupUsersList#setMultiActions(org.opencms.workplace.list.CmsListMetadata)
185: */
186: protected void setMultiActions(CmsListMetadata metadata) {
187:
188: super .setMultiActions(metadata);
189:
190: CmsListMultiAction addMultiAction = metadata
191: .getMultiAction(LIST_MACTION_ADD);
192: addMultiAction.setName(Messages.get().container(
193: Messages.GUI_SUBSCRIBERS_LIST_MACTION_ADD_NAME_0));
194: addMultiAction.setHelpText(Messages.get().container(
195: Messages.GUI_SUBSCRIBERS_LIST_MACTION_ADD_HELP_0));
196: addMultiAction.setConfirmationMessage(Messages.get().container(
197: Messages.GUI_SUBSCRIBERS_LIST_MACTION_ADD_CONF_0));
198: }
199:
200: /**
201: * @see org.opencms.workplace.tools.accounts.A_CmsGroupUsersList#validateParamaters()
202: */
203: protected void validateParamaters() throws Exception {
204:
205: super .validateParamaters();
206: // this is to prevent the switch to the root ou
207: // if the oufqn param get lost (by reloading for example)
208: if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamOufqn())) {
209: throw new Exception();
210: }
211: }
212:
213: }
|