⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a_cmslistexplorerdialog.java

📁 找了很久才找到到源代码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/*
 * File   : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/list/A_CmsListExplorerDialog.java,v $
 * Date   : $Date: 2007-08-13 16:29:48 $
 * Version: $Revision: 1.8 $
 *
 * This library is part of OpenCms -
 * the Open Source Content Management System
 *
 * Copyright (c) 2002 - 2007 Alkacon Software GmbH (http://www.alkacon.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * For further information about Alkacon Software GmbH, please see the
 * company website: http://www.alkacon.com
 *
 * For further information about OpenCms, please see the
 * project website: http://www.opencms.org
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package org.opencms.workplace.list;

import org.opencms.db.CmsUserSettings;
import org.opencms.file.CmsProject;
import org.opencms.file.CmsResource;
import org.opencms.i18n.CmsMessageContainer;
import org.opencms.jsp.CmsJspActionElement;
import org.opencms.main.CmsException;
import org.opencms.main.OpenCms;
import org.opencms.util.CmsUUID;
import org.opencms.workplace.CmsDialog;
import org.opencms.workplace.CmsWorkplaceSettings;
import org.opencms.workplace.commons.CmsTouch;
import org.opencms.workplace.explorer.CmsExplorer;
import org.opencms.workplace.explorer.CmsResourceUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

/**
 * Provides a list dialog for resources.<p> 
 *
 * @author  Michael Moossen 
 * 
 * @version $Revision: 1.8 $ 
 * 
 * @since 6.0.0 
 */
public abstract class A_CmsListExplorerDialog extends A_CmsListDialog {

    /** List action id constant. */
    public static final String LIST_ACTION_EDIT = "eae";

    /** List action id constant. */
    public static final String LIST_ACTION_LOCKICON = "eal";

    /** List action id constant. */
    public static final String LIST_ACTION_PROJSTATEICON = "eaps";

    /** List action id constant. */
    public static final String LIST_ACTION_TYPEICON = "eai";

    /** List column id constant. */
    public static final String LIST_COLUMN_DATECREATE = "ecdc";

    /** List column id constant. */
    public static final String LIST_COLUMN_DATEEXP = "ecde";

    /** List column id constant. */
    public static final String LIST_COLUMN_DATELASTMOD = "ecdl";

    /** List column id constant. */
    public static final String LIST_COLUMN_DATEREL = "ecdr";

    /** List column id constant. */
    public static final String LIST_COLUMN_EDIT = "ece";

    /** List column id constant. */
    public static final String LIST_COLUMN_LOCKEDBY = "eclb";

    /** List column id constant. */
    public static final String LIST_COLUMN_LOCKICON = "ecli";

    /** List column id constant. */
    public static final String LIST_COLUMN_NAME = "ecn";

    /** List column id constant. */
    public static final String LIST_COLUMN_PERMISSIONS = "ecp";

    /** List column id constant. */
    public static final String LIST_COLUMN_PROJSTATEICON = "ecpi";

    /** List column id constant. */
    public static final String LIST_COLUMN_ROOT_PATH = "crp";

    /** List column id constant. */
    public static final String LIST_COLUMN_SITE = "ecsi";

    /** List column id constant. */
    public static final String LIST_COLUMN_SIZE = "ecz";

    /** List column id constant. */
    public static final String LIST_COLUMN_STATE = "ecs";

    /** List column id constant. */
    public static final String LIST_COLUMN_TITLE = "ect";

    /** List column id constant. */
    public static final String LIST_COLUMN_TYPE = "ecy";

    /** List column id constant. */
    public static final String LIST_COLUMN_TYPEICON = "ecti";

    /** List column id constant. */
    public static final String LIST_COLUMN_USERCREATE = "ecuc";

    /** List column id constant. */
    public static final String LIST_COLUMN_USERLASTMOD = "ecul";

    /** List default action id constant. */
    public static final String LIST_DEFACTION_OPEN = "edo";

    /** Request parameter name for the show explorer flag. */
    public static final String PARAM_SHOW_EXPLORER = "showexplorer";

    /** Explorer list JSP path. */
    public static final String PATH_EXPLORER_LIST = PATH_DIALOGS + "list-explorer.jsp";

    /** Column visibility flags container. */
    private Map m_colVisibilities;

    /** Stores the value of the request parameter for the show explorer flag. */
    private String m_paramShowexplorer;

    /** Instance resource util. */
    private CmsResourceUtil m_resourceUtil;

    /**
     * Creates a new explorer list ordered and searchable by name.<p>
     * 
     * @param jsp an initialized JSP action element
     * @param listId the id of the displayed list
     * @param listName the name of the list
     */
    protected A_CmsListExplorerDialog(CmsJspActionElement jsp, String listId, CmsMessageContainer listName) {

        this(jsp, listId, listName, LIST_COLUMN_NAME, CmsListOrderEnum.ORDER_ASCENDING, LIST_COLUMN_NAME);
    }

    /**
     * Default constructor.<p>
     * 
     * @param jsp an initialized JSP action element
     * @param listId the id of the displayed list
     * @param listName the name of the list
     * @param sortedColId the a priory sorted column
     * @param sortOrder the order of the sorted column
     * @param searchableColId the column to search into
     */
    protected A_CmsListExplorerDialog(
        CmsJspActionElement jsp,
        String listId,
        CmsMessageContainer listName,
        String sortedColId,
        CmsListOrderEnum sortOrder,
        String searchableColId) {

        super(jsp, listId, listName, sortedColId, sortOrder, searchableColId);
    }

    /**
     * @see org.opencms.workplace.list.A_CmsListDialog#executeListIndepActions()
     */
    public void executeListIndepActions() {

        if (getParamListAction().equals(CmsListIndependentAction.ACTION_EXPLORER_SWITCH_ID)) {
            Map params = new HashMap();
            // set action parameter to initial dialog call
            params.put(CmsDialog.PARAM_ACTION, CmsDialog.DIALOG_INITIAL);
            params.putAll(getToolManager().getCurrentTool(this).getHandler().getParameters(this));

            getSettings().setCollector(getCollector());
            getSettings().setExplorerMode(CmsExplorer.VIEW_LIST);
            getSettings().setExplorerProjectId(getProject().getUuid());
            setShowExplorer(true);
            try {
                getToolManager().jspForwardPage(this, PATH_EXPLORER_LIST, params);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        } else {
            super.executeListIndepActions();
        }
    }

    /**
     * Returns the collector to use to display the resources.<p>
     * 
     * @return the collector to use to display the resources
     */
    public abstract I_CmsListResourceCollector getCollector();

    /**
     * Returns the Show explorer parameter value.<p>
     *
     * @return the Show explorer parameter value
     */
    public String getParamShowexplorer() {

        return m_paramShowexplorer;
    }

    /**
     * Returns an appropiate initialized resource util object.<p>
     * 
     * @return a resource util object
     */
    public CmsResourceUtil getResourceUtil() {

        if (m_resourceUtil == null) {
            m_resourceUtil = new CmsResourceUtil(getCms());
            m_resourceUtil.setReferenceProject(getProject());
        }
        return m_resourceUtil;
    }

    /**
     * Returns an appropiate initialized resource util object for the given item.<p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -