001/*
002 * File   : $Source$
003 * Date   : $Date$
004 * Version: $Revision$
005 *
006 * This library is part of OpenCms -
007 * the Open Source Content Management System
008 *
009 * Copyright (C) 2002 - 2009 Alkacon Software (http://www.alkacon.com)
010 *
011 * This library is free software; you can redistribute it and/or
012 * modify it under the terms of the GNU Lesser General Public
013 * License as published by the Free Software Foundation; either
014 * version 2.1 of the License, or (at your option) any later version.
015 *
016 * This library is distributed in the hope that it will be useful,
017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019 * Lesser General Public License for more details.
020 *
021 * For further information about Alkacon Software, please see the
022 * company website: http://www.alkacon.com
023 *
024 * For further information about OpenCms, please see the
025 * project website: http://www.opencms.org
026 *
027 * You should have received a copy of the GNU Lesser General Public
028 * License along with this library; if not, write to the Free Software
029 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
030 */
031
032package org.opencms.workplace.tools.sites;
033
034import org.opencms.configuration.CmsSitesConfiguration;
035import org.opencms.file.CmsObject;
036import org.opencms.file.CmsResource;
037import org.opencms.i18n.CmsMessageContainer;
038import org.opencms.jsp.CmsJspActionElement;
039import org.opencms.main.CmsException;
040import org.opencms.main.CmsRuntimeException;
041import org.opencms.main.OpenCms;
042import org.opencms.site.CmsSite;
043import org.opencms.site.CmsSiteMatcher;
044import org.opencms.util.CmsStringUtil;
045import org.opencms.workplace.CmsWorkplace;
046import org.opencms.workplace.list.A_CmsListDialog;
047import org.opencms.workplace.list.CmsListColumnAlignEnum;
048import org.opencms.workplace.list.CmsListColumnDefinition;
049import org.opencms.workplace.list.CmsListDefaultAction;
050import org.opencms.workplace.list.CmsListDirectAction;
051import org.opencms.workplace.list.CmsListItem;
052import org.opencms.workplace.list.CmsListItemActionIconComparator;
053import org.opencms.workplace.list.CmsListItemDetails;
054import org.opencms.workplace.list.CmsListItemDetailsFormatter;
055import org.opencms.workplace.list.CmsListMetadata;
056import org.opencms.workplace.list.CmsListMultiAction;
057import org.opencms.workplace.list.CmsListOrderEnum;
058import org.opencms.workplace.tools.CmsToolDialog;
059
060import java.io.IOException;
061import java.util.ArrayList;
062import java.util.HashMap;
063import java.util.List;
064import java.util.Map;
065
066import javax.servlet.ServletException;
067import javax.servlet.http.HttpServletRequest;
068import javax.servlet.http.HttpServletResponse;
069import javax.servlet.jsp.PageContext;
070
071/**
072 * Main site management view.<p>
073 *
074 * @since 9.0.0
075 */
076public class CmsSitesOverviewList extends A_CmsListDialog {
077
078    /** The message key prefix to be used for widget labels. */
079    public static final String KEY_PREFIX_SITES = "sites";
080
081    /** The inactive icon for single delete action. */
082    protected static final String ICON_DELETE_INACTIVE = "list/delete_inactive.png";
083
084    /** List column id. */
085    protected static final String LIST_COLUMN_ACTIVE = "wsi";
086
087    /** The path of the fav icon. */
088    protected static final String LIST_ICON_FAVICON = "tools/sites/icons/small/default-favicon.png";
089
090    /** Holds - keys: site roots and values: favicon links. */
091    protected static Map<String, String> m_icons = new HashMap<String, String>();
092
093    /** A parameter name for the title of the site. */
094    protected static final String PARAM_SITE_TITLE = "sitetitle";
095
096    /** A parameter name for a comma separated list of site paths. */
097    protected static final String PARAM_SITES = "sites";
098
099    /** Path to the reports. */
100    protected static final String PATH_REPORTS = "/system/workplace/admin/sites/reports/";
101
102    /** The favorite upload dialog. */
103    private static final String DIALOG_FAV = "fav";
104
105    /** List action id. */
106    private static final String LIST_ACTION_ACTIVATE = "wsa";
107
108    /** List action id. */
109    private static final String LIST_ACTION_DEACTIVATE = "wsd";
110
111    /** List default action for editing a site. */
112    private static final String LIST_ACTION_DEFAULT = "da";
113
114    /** List action for editing a site. */
115    private static final String LIST_ACTION_EDIT = "ea";
116
117    /** List action for uploading a favicon. */
118    private static final String LIST_ACTION_FAVICON = "fa";
119
120    /** List action for removing a site. */
121    private static final String LIST_ACTION_REMOVE = "ra";
122
123    /** List column id. */
124    private static final String LIST_COLUMN_ACTIVATE = "wsc";
125
126    /** List column id for editing a site. */
127    private static final String LIST_COLUMN_EDIT = "ce";
128
129    /** List column id for the favicon. */
130    private static final String LIST_COLUMN_FAVICON = "fav";
131
132    /** List column id for the site path. */
133    private static final String LIST_COLUMN_PATH = "cp";
134
135    /** List column id for removing a site. */
136    private static final String LIST_COLUMN_REMOVE = "cr";
137
138    /** List column id for the site server's URL. */
139    private static final String LIST_COLUMN_SERVER = "cs";
140
141    /** List column id for the site name. */
142    private static final String LIST_COLUMN_TITLE = "cn";
143
144    /** Identifier for the show aliases action. */
145    private static final String LIST_DETAIL_ALIASES = "ad";
146
147    /** Identifier for the show secure sites action. */
148    private static final String LIST_DETAIL_SECURE = "sd";
149
150    /** Path to the edit icon. */
151    private static final String LIST_ICON_EDIT = "tools/sites/icons/small/sites.png";
152
153    /** Identifier for the remove multi action. */
154    private static final String LIST_MACTION_REMOVE = "rma";
155
156    /** Id for the list of sites. */
157    private static final String LIST_SITES_ID = "sites";
158
159    /** A parameter name for the edit action. */
160    private static final String PARAM_EDIT_ACTION = "editaction";
161
162    /**
163     * Public constructor.<p>
164     *
165     * @param jsp an initialized JSP action element
166     */
167    public CmsSitesOverviewList(CmsJspActionElement jsp) {
168
169        super(
170            jsp,
171            LIST_SITES_ID,
172            Messages.get().container(Messages.GUI_SITES_LIST_NAME_0),
173            LIST_COLUMN_PATH,
174            CmsListOrderEnum.ORDER_ASCENDING,
175            null);
176    }
177
178    /**
179     * Public constructor with JSP variables.<p>
180     *
181     * @param context the JSP page context
182     * @param req the JSP request
183     * @param res the JSP response
184     */
185    public CmsSitesOverviewList(PageContext context, HttpServletRequest req, HttpServletResponse res) {
186
187        this(new CmsJspActionElement(context, req, res));
188    }
189
190    /**
191     * @see org.opencms.workplace.list.A_CmsListDialog#executeListMultiActions()
192     */
193    @Override
194    public void executeListMultiActions() throws IOException, ServletException {
195
196        if (getParamListAction().equals(LIST_MACTION_REMOVE)) {
197            List<String> selectedSites = new ArrayList<String>();
198            for (CmsListItem item : getSelectedItems()) {
199                if (!OpenCms.getSiteManager().getDefaultSite().getSiteRoot().equals(item.getId())) {
200                    selectedSites.add(item.getId());
201                }
202            }
203            Map<String, String[]> params = new HashMap<String, String[]>();
204            params.put(PARAM_SITES, new String[] {CmsStringUtil.listAsString(selectedSites, ",")});
205            params.put(PARAM_ACTION, new String[] {DIALOG_INITIAL});
206            params.put(PARAM_STYLE, new String[] {CmsToolDialog.STYLE_NEW});
207            getToolManager().jspForwardPage(this, PATH_REPORTS + "remove.jsp", params);
208        }
209        listSave();
210    }
211
212    /**
213     * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions()
214     */
215    @Override
216    public void executeListSingleActions() throws IOException, ServletException {
217
218        String siteId = getSelectedItem().getId();
219        Map<String, String[]> params = new HashMap<String, String[]>();
220        CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot(siteId);
221        params.put(PARAM_SITES, new String[] {siteId});
222        params.put(PARAM_ACTION, new String[] {DIALOG_INITIAL});
223        params.put(PARAM_SITE_TITLE, new String[] {site.getTitle()});
224        if (getParamListAction().equals(LIST_ACTION_EDIT)) {
225            // forward to the edit site dialog
226            params.put(PARAM_EDIT_ACTION, new String[] {CmsSiteDetailDialog.DIALOG_EDIT});
227            getToolManager().jspForwardTool(this, "/sites/detail/edit", params);
228        } else if (getParamListAction().equals(LIST_ACTION_DEFAULT)) {
229            getToolManager().jspForwardTool(this, "/sites/detail", params);
230        } else if (getParamListAction().equals(LIST_ACTION_ACTIVATE)
231            || getParamListAction().equals(LIST_ACTION_DEACTIVATE)) {
232            if (getParamListAction().equals(LIST_ACTION_ACTIVATE)) {
233                site.setWebserver(true);
234            } else {
235                site.setWebserver(false);
236            }
237            try {
238                // update the XML configuration
239                OpenCms.getSiteManager().updateSite(getCms(), site, site);
240                OpenCms.writeConfiguration(CmsSitesConfiguration.class);
241            } catch (CmsException e) {
242                // should never happen
243                throw new CmsRuntimeException(Messages.get().container(Messages.ERR_SITES_WEBSERVER_1, site), e);
244            }
245        } else if (getParamListAction().equals(LIST_ACTION_REMOVE)) {
246            // forward to the remove site dialog
247            params.put(PARAM_STYLE, new String[] {CmsToolDialog.STYLE_NEW});
248            getToolManager().jspForwardPage(this, PATH_REPORTS + "remove.jsp", params);
249        } else if (getParamListAction().equals(LIST_ACTION_FAVICON)) {
250            // forward to the upload favorite page
251            params.put(PARAM_EDIT_ACTION, new String[] {DIALOG_FAV});
252            getToolManager().jspForwardTool(this, "/sites/detail/fav", params);
253        }
254        listSave();
255    }
256
257    /**
258     * @see org.opencms.workplace.list.A_CmsListDialog#fillDetails(java.lang.String)
259     */
260    @Override
261    protected void fillDetails(String detailId) {
262
263        List<CmsListItem> items = getList().getAllContent();
264        for (CmsListItem item : items) {
265            String sitePath = item.getId();
266            CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot(sitePath);
267            StringBuffer html = new StringBuffer(128);
268            if (detailId.equals(LIST_DETAIL_ALIASES)) {
269                boolean first = true;
270                for (CmsSiteMatcher matcher : site.getAliases()) {
271                    if (first) {
272                        html.append(matcher.getUrl());
273                        first = false;
274                    } else {
275                        html.append("<br/>" + matcher.getUrl());
276                    }
277                }
278            }
279            if (detailId.equals(LIST_DETAIL_SECURE) && site.hasSecureServer()) {
280                html.append(site.getSecureUrl());
281            }
282            item.set(detailId, html.toString());
283        }
284    }
285
286    /**
287     * @see org.opencms.workplace.list.A_CmsListDialog#getListItems()
288     */
289    @Override
290    protected List<CmsListItem> getListItems() {
291
292        List<CmsListItem> result = new ArrayList<CmsListItem>();
293
294        CmsObject cms = null;
295        try {
296            cms = OpenCms.initCmsObject(getCms());
297            cms.getRequestContext().setSiteRoot("");
298        } catch (CmsException e) {
299            // noop
300        }
301
302        // clear the icons
303        m_icons.clear();
304
305        List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites(getCms(), true);
306        for (CmsSite site : sites) {
307            if (site.getSiteMatcher() != null) {
308                CmsListItem item = getList().newItem(site.getSiteRoot());
309                item.set(LIST_COLUMN_PATH, site.getSiteRoot());
310                item.set(LIST_COLUMN_SERVER, site.getUrl() != null ? site.getUrl() : "-");
311                item.set(LIST_COLUMN_TITLE, site.getTitle() != null ? site.getTitle() : "-");
312                if (cms != null) {
313                    try {
314                        CmsResource res = cms.readResource(site.getSiteRoot() + "/" + CmsSiteFaviconDialog.ICON_NAME);
315                        m_icons.put(site.getSiteRoot(), getJsp().link(res.getRootPath()));
316                    } catch (CmsException e) {
317                        // noop
318                    }
319                }
320                item.set(LIST_COLUMN_ACTIVE, Boolean.valueOf(site.isWebserver()));
321                result.add(item);
322            }
323        }
324        return result;
325    }
326
327    /**
328     * @see org.opencms.workplace.list.A_CmsListDialog#setColumns(org.opencms.workplace.list.CmsListMetadata)
329     */
330    @Override
331    protected void setColumns(CmsListMetadata metadata) {
332
333        // create edit column
334        CmsListColumnDefinition editCol = new CmsListColumnDefinition(LIST_COLUMN_EDIT);
335        editCol.setName(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_EDIT_NAME_0));
336        editCol.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_EDIT_HELP_0));
337        editCol.setWidth("20");
338        editCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER);
339        editCol.setSorteable(false);
340        // add edit action
341        CmsListDirectAction editAction = new CmsListDirectAction(LIST_ACTION_EDIT);
342        editAction.setName(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_EDIT_NAME_0));
343        editAction.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_EDIT_HELP_0));
344        editAction.setIconPath(LIST_ICON_EDIT);
345        editCol.addDirectAction(editAction);
346        metadata.addColumn(editCol);
347
348        // create web server column
349        CmsListColumnDefinition activateCol = new CmsListColumnDefinition(LIST_COLUMN_ACTIVATE);
350        activateCol.setName(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_ACTIVE_0));
351        activateCol.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_ACTIVE_HELP_0));
352        activateCol.setWidth("20");
353        activateCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER);
354        activateCol.setListItemComparator(new CmsListItemActionIconComparator());
355        CmsListDirectAction activateForConig = new CmsListDirectAction(LIST_ACTION_ACTIVATE) {
356
357            /**
358             * @see org.opencms.workplace.tools.A_CmsHtmlIconButton#isVisible()
359             */
360            @Override
361            public boolean isVisible() {
362
363                if (getItem() != null) {
364                    return !((Boolean)getItem().get(LIST_COLUMN_ACTIVE)).booleanValue();
365                }
366                return super.isVisible();
367            }
368        };
369        activateForConig.setName(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_ACTIVATE_NAME_0));
370        activateForConig.setConfirmationMessage(
371            Messages.get().container(Messages.GUI_SITES_LIST_ACTION_ACTIVATE_CONF_0));
372        activateForConig.setIconPath(ICON_INACTIVE);
373        activateForConig.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_ACTIVATE_HELP_0));
374        activateCol.addDirectAction(activateForConig);
375        // direct action: deactivate job
376        CmsListDirectAction deactivateForConfig = new CmsListDirectAction(LIST_ACTION_DEACTIVATE) {
377
378            /**
379             * @see org.opencms.workplace.tools.A_CmsHtmlIconButton#isVisible()
380             */
381            @Override
382            public boolean isVisible() {
383
384                if (getItem() != null) {
385                    return ((Boolean)getItem().get(LIST_COLUMN_ACTIVE)).booleanValue();
386                }
387                return super.isVisible();
388            }
389        };
390        deactivateForConfig.setName(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_DEACTIVATE_NAME_0));
391        deactivateForConfig.setConfirmationMessage(
392            Messages.get().container(Messages.GUI_SITES_LIST_ACTION_DEACTIVATE_CONF_0));
393        deactivateForConfig.setIconPath(ICON_ACTIVE);
394        deactivateForConfig.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_DEACTIVATE_HELP_0));
395        activateCol.addDirectAction(deactivateForConfig);
396        metadata.addColumn(activateCol);
397
398        // create remove column
399        CmsListColumnDefinition removeCol = new CmsListColumnDefinition(LIST_COLUMN_REMOVE);
400        removeCol.setName(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_REMOVE_NAME_0));
401        removeCol.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_REMOVE_HELP_0));
402        removeCol.setWidth("20");
403        removeCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER);
404        removeCol.setSorteable(false);
405        // add remove action
406        CmsListDirectAction removeAction = new CmsListDirectAction(LIST_ACTION_REMOVE) {
407
408            /**
409             * @see org.opencms.workplace.tools.A_CmsHtmlIconButton#getHelpText()
410             */
411            @Override
412            public CmsMessageContainer getHelpText() {
413
414                if (!OpenCms.getSiteManager().getDefaultSite().getSiteRoot().equals(getItem().getId())) {
415                    return Messages.get().container(Messages.GUI_SITES_LIST_ACTION_REMOVE_HELP_0);
416                } else {
417                    return Messages.get().container(Messages.GUI_SITES_LIST_ACTION_DEFAULT_SITE_REMOVE_HELP_0);
418                }
419            }
420
421            /**
422             * @see org.opencms.workplace.tools.A_CmsHtmlIconButton#getIconPath()
423             */
424            @Override
425            public String getIconPath() {
426
427                if (!OpenCms.getSiteManager().getDefaultSite().getSiteRoot().equals(getItem().getId())) {
428                    return ICON_DELETE;
429                } else {
430                    return ICON_DELETE_INACTIVE;
431                }
432            }
433
434            /**
435             * @see org.opencms.workplace.tools.A_CmsHtmlIconButton#getName()
436             */
437            @Override
438            public CmsMessageContainer getName() {
439
440                if (!OpenCms.getSiteManager().getDefaultSite().getSiteRoot().equals(getItem().getId())) {
441                    return Messages.get().container(Messages.GUI_SITES_LIST_ACTION_REMOVE_NAME_0);
442                } else {
443                    return Messages.get().container(Messages.GUI_SITES_LIST_ACTION_DEFAULT_SITE_REMOVE_NAME_0);
444                }
445            }
446
447            /**
448             * @see org.opencms.workplace.tools.A_CmsHtmlIconButton#isEnabled()
449             */
450            @Override
451            public boolean isEnabled() {
452
453                return !OpenCms.getSiteManager().getDefaultSite().getSiteRoot().equals(getItem().getId());
454            }
455        };
456        removeAction.setConfirmationMessage(Messages.get().container(Messages.GUI_SITES_LIST_MACTION_REMOVE_CONF_0));
457        removeCol.addDirectAction(removeAction);
458        metadata.addColumn(removeCol);
459
460        // create favicon column
461        CmsListColumnDefinition favCol = new CmsListColumnDefinition(LIST_COLUMN_FAVICON);
462        favCol.setName(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_FAVICON_NAME_0));
463        favCol.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_FAVICON_HELP_0));
464        favCol.setWidth("20");
465        favCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER);
466        favCol.setSorteable(false);
467        // add fav icon action
468        CmsListDirectAction faviconAction = new CmsListDirectAction(LIST_ACTION_FAVICON) {
469
470            /**
471             * @see org.opencms.workplace.list.A_CmsListAction#buttonHtml()
472             */
473            @Override
474            public String buttonHtml() {
475
476                String button = super.buttonHtml();
477                String iconP = m_icons.get(getItem().getId());
478                if (iconP != null) {
479                    button = button.replaceAll(CmsWorkplace.getSkinUri() + getIconPath(), iconP);
480                }
481                return button;
482            }
483        };
484        faviconAction.setName(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_FAVICON_NAME_0));
485        faviconAction.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_FAVICON_HELP_0));
486        faviconAction.setIconPath(LIST_ICON_FAVICON);
487        favCol.addDirectAction(faviconAction);
488        metadata.addColumn(favCol);
489
490        // create server column
491        CmsListColumnDefinition serverCol = new CmsListColumnDefinition(LIST_COLUMN_SERVER);
492        serverCol.setAlign(CmsListColumnAlignEnum.ALIGN_LEFT);
493        serverCol.setName(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_SERVER_NAME_0));
494        serverCol.setWidth("33%");
495        CmsListDefaultAction defAction = new CmsListDefaultAction(LIST_ACTION_DEFAULT);
496        defAction.setName(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_EDIT_NAME_0));
497        defAction.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_ACTION_EDIT_HELP_0));
498        serverCol.addDefaultAction(defAction);
499        metadata.addColumn(serverCol);
500
501        // create title column
502        CmsListColumnDefinition titleCol = new CmsListColumnDefinition(LIST_COLUMN_TITLE);
503        titleCol.setAlign(CmsListColumnAlignEnum.ALIGN_LEFT);
504        titleCol.setName(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_TITLE_NAME_0));
505        titleCol.setWidth("33%");
506        metadata.addColumn(titleCol);
507
508        // create path column
509        CmsListColumnDefinition pathCol = new CmsListColumnDefinition(LIST_COLUMN_PATH);
510        pathCol.setAlign(CmsListColumnAlignEnum.ALIGN_LEFT);
511        pathCol.setName(Messages.get().container(Messages.GUI_SITES_LIST_COLUMN_PATH_NAME_0));
512        pathCol.setWidth("33%");
513        metadata.addColumn(pathCol);
514
515        // add column for activation information
516        CmsListColumnDefinition actInfoCol = new CmsListColumnDefinition(LIST_COLUMN_ACTIVE);
517        actInfoCol.setVisible(false);
518        metadata.addColumn(actInfoCol);
519    }
520
521    /**
522     * @see org.opencms.workplace.list.A_CmsListDialog#setIndependentActions(org.opencms.workplace.list.CmsListMetadata)
523     */
524    @Override
525    protected void setIndependentActions(CmsListMetadata metadata) {
526
527        // add the detail action for showing aliases
528        CmsListItemDetails aliasesDetails = new CmsListItemDetails(LIST_DETAIL_ALIASES);
529        aliasesDetails.setAtColumn(LIST_COLUMN_SERVER);
530        aliasesDetails.setVisible(false);
531        aliasesDetails.setFormatter(
532            new CmsListItemDetailsFormatter(Messages.get().container(Messages.GUI_SITES_DETAIL_LABEL_ALIASES_0)));
533        aliasesDetails.setShowActionName(Messages.get().container(Messages.GUI_SITES_DETAIL_SHOW_ALIASES_NAME_0));
534        aliasesDetails.setShowActionHelpText(Messages.get().container(Messages.GUI_SITES_DETAIL_SHOW_ALIASES_HELP_0));
535        aliasesDetails.setHideActionName(Messages.get().container(Messages.GUI_SITES_DETAIL_HIDE_ALIASES_NAME_0));
536        aliasesDetails.setHideActionHelpText(Messages.get().container(Messages.GUI_SITES_DETAIL_HIDE_ALIASES_HELP_0));
537        // add author info item detail to meta data
538        metadata.addItemDetails(aliasesDetails);
539
540        // add the detail action for showing secure sites
541        CmsListItemDetails secureDetails = new CmsListItemDetails(LIST_DETAIL_SECURE);
542        secureDetails.setAtColumn(LIST_COLUMN_SERVER);
543        secureDetails.setVisible(false);
544        secureDetails.setFormatter(
545            new CmsListItemDetailsFormatter(Messages.get().container(Messages.GUI_SITES_DETAIL_LABEL_SECURE_0)));
546        secureDetails.setShowActionName(Messages.get().container(Messages.GUI_SITES_DETAIL_SHOW_SECURE_NAME_0));
547        secureDetails.setShowActionHelpText(Messages.get().container(Messages.GUI_SITES_DETAIL_SHOW_SECURE_HELP_0));
548        secureDetails.setHideActionName(Messages.get().container(Messages.GUI_SITES_DETAIL_HIDE_SECURE_NAME_0));
549        secureDetails.setHideActionHelpText(Messages.get().container(Messages.GUI_SITES_DETAIL_HIDE_SECURE_HELP_0));
550        // add author info item detail to meta data
551        metadata.addItemDetails(secureDetails);
552    }
553
554    /**
555     * @see org.opencms.workplace.list.A_CmsListDialog#setMultiActions(org.opencms.workplace.list.CmsListMetadata)
556     */
557    @Override
558    protected void setMultiActions(CmsListMetadata metadata) {
559
560        // add the remove multiple sites action
561        CmsListMultiAction removeSites = new CmsListMultiAction(LIST_MACTION_REMOVE);
562        removeSites.setName(Messages.get().container(Messages.GUI_SITES_LIST_MACTION_REMOVE_NAME_0));
563        removeSites.setConfirmationMessage(Messages.get().container(Messages.GUI_SITES_LIST_MACTION_REMOVE_CONF_0));
564        removeSites.setIconPath(ICON_MULTI_DELETE);
565        removeSites.setEnabled(true);
566        removeSites.setHelpText(Messages.get().container(Messages.GUI_SITES_LIST_MACTION_REMOVE_HELP_0));
567        metadata.addMultiAction(removeSites);
568    }
569}