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

📄 a_cmsbackoffice.java

📁 cms是开源的框架
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
/*
* File   : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/defaults/A_CmsBackoffice.java,v $
* Date   : $Date: 2005/06/27 23:22:23 $
* Version: $Revision: 1.9 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
*
* Copyright (C) 2001  The OpenCms Group
*
* 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 OpenCms, please see the
* OpenCms 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 com.opencms.defaults;

import org.opencms.db.CmsUserSettings;
import org.opencms.file.CmsGroup;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsProject;
import org.opencms.file.CmsResource;
import org.opencms.file.CmsUser;
import org.opencms.i18n.CmsEncoder;
import org.opencms.main.CmsException;
import org.opencms.main.CmsLog;
import org.opencms.util.CmsDateUtil;
import org.opencms.util.CmsUUID;

import com.opencms.core.I_CmsSession;
import com.opencms.defaults.master.CmsPlausibilizationException;
import com.opencms.legacy.CmsLegacyException;
import com.opencms.legacy.CmsXmlTemplateLoader;
import com.opencms.template.A_CmsXmlContent;
import com.opencms.template.CmsXmlTemplateFile;
import com.opencms.workplace.CmsWorkplaceDefault;
import com.opencms.workplace.CmsXmlLanguageFile;
import com.opencms.workplace.CmsXmlWpTemplateFile;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.List;
import java.util.Vector;

/**
 * Abstract class for generic backoffice display. It automatically
 * generates the <ul><li>head section with filters and buttons,</li>
 *                  <li>body section with the table data,</li>
 *                  <li>lock states of the entries. if there are any,</li>
 *                  <li>delete dialog,</li>
 *                  <li>lock dialog.</li></ul>
 * calls the <ul><li>edit dialog of the calling backoffice class</li>
 *              <li>new dialog of the calling backoffice class</li></ul>
 * using the content definition class defined by the getContentDefinition method.
 * The methods and data provided by the content definition class
 * is accessed by reflection. This way it is possible to re-use
 * this class for any content definition class, that just has
 * to extend the A_CmsContentDefinition class!
 * Creation date: (27.10.00 10:04:42)
 * 
 * @author Michael Knoll
 * @author Michael Emmerich
 * @version $Revision: 1.9 $
 * 
 * @deprecated Will not be supported past the OpenCms 6 release.
 */
public abstract class A_CmsBackoffice extends CmsWorkplaceDefault {

    /** Value for state: not locked. */
    public static int C_NOT_LOCKED = -1;
    
    /** Value for no access. */
    public static int C_NO_ACCESS = -2;

    private static String C_DEFAULT_SELECTOR = "(default)";
    private static String C_DONE_SELECTOR = "done";

    /** The style for unchanged files or folders. */
    private static final String C_STYLE_UNCHANGED = "dateingeandert";

    /** The style for files or folders not in project. */
    private static final String C_STYLE_NOTINPROJECT = "dateintprojekt";

    /** The style for new files or folders. */
    private static final String C_STYLE_NEW = "dateineu";

    /** The style for deleted files or folders. */
    private static final String C_STYLE_DELETED = "dateigeloescht";

    /** The style for changed files or folders. */
    private static final String C_STYLE_CHANGED = "dateigeaendert";

    /** Default value of permission.*/
    protected static final int C_DEFAULT_PERMISSIONS = 383;

    /** Possible accessflags. */
    protected static final String[] C_ACCESS_FLAGS = {"1", "2", "4", "8", "16", "32", "64", "128", "256"};

    /**
    * Gets the backoffice url of the module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return A string with the backoffice url
    * @throws Exception if something goes wrong
    */
    public abstract String getBackofficeUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception;
    /**
    * Gets the create url of the module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return a string with the create url
    * @throws Exception if something goes wrong
    */
    public abstract String getCreateUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception;

    /**
    * Gets the edit url of the module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return A string with the edit url
    * @throws Exception if something goes wrong
    */
    public abstract String getEditUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception;

    /**
    * Gets the edit url of the module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return A string with the edit url
    * @throws Exception if something goes wrong
    */
    public String getDeleteUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception {

        return getBackofficeUrl(cms, tagcontent, doc, userObject);
    }

    /**
    * Gets the undelete url of the module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return A string with the undelete url
    * @throws Exception if something goes wrong
    */
    public String getUndeleteUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception {

        return getBackofficeUrl(cms, tagcontent, doc, userObject);
    }

    /**
    * Gets the publish url of the module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return A string with the publish url
    * @throws Exception if something goes wrong
    */
    public String getPublishUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception {

        return getBackofficeUrl(cms, tagcontent, doc, userObject);
    }

    /**
    * Gets the history url of the module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return A string with the history url
    * @throws Exception if something goes wrong
    */
    public String getHistoryUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception {

        return getBackofficeUrl(cms, tagcontent, doc, userObject);
    }

    /**
    * Gets the redirect url of the module. This URL is called, when an entry of the file list is selected.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return a string with the  url
    * @throws Exception if something goes wrong
    */
    public String getUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception {
        return "";
    }

    /**
    * Gets the setup url of the module. This is the url of the setup page for this module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return a string with the  setup url
    * @throws Exception if something goes wrong
    */
    public String getSetupUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception {
        return "";
    }

    /**
    * Gets the preview url of the module. This is the url of the preview page for this module.
    * 
    * @param cms the cms object
    * @param tagcontent the tag body content
    * @param doc the xml document
    * @param userObject additional parameter values
    * @return a string with the  setup url
    * @throws Exception if something goes wrong
    */
    public String getPreviewUrl(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) throws Exception {
        return "";
    }

    /**
     * Gets the content of a given template file.
     * This method displays any content provided by a content definition
     * class on the template. The used backoffice class does not need to use a
     * special getContent method. It just has to extend the methods of this class!
     * Using reflection, this method creates the table headline and table content
     * with the layout provided by the template automatically!
     * 
     * @param cms A_CmsObject Object for accessing system resources
     * @param templateFile Filename of the template file
     * @param elementName <em>not used here</em>.
     * @param parameters <em>not used here</em>.
     * @param templateSelector template section that should be processed.
     * @return Processed content of the given template file.
     * @throws CmsException if something goes wrong
     */

    public byte[] getContent(CmsObject cms, String templateFile, String elementName, Hashtable parameters, String templateSelector) throws CmsException {

        //return var
        byte[] returnProcess = null;

        // the CD to be used
        A_CmsContentDefinition cd = null;

        // session will be created or fetched
        I_CmsSession session = CmsXmlTemplateLoader.getSession(cms.getRequestContext(), true);
        session = CmsXmlTemplateLoader.getSession(cms.getRequestContext(), true);
        //create new workplace templatefile object
        CmsXmlWpTemplateFile template = new CmsXmlWpTemplateFile(cms, templateFile);
        //get parameters
        String selectBox = (String)parameters.get("selectbox");

⌨️ 快捷键说明

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