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

📄 cmsjspactionelement.java

📁 cms是开源的框架
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
            return null;
        }
        if (m_navigation == null) {
            m_navigation = new CmsJspNavBuilder(getController().getCmsObject());
        }
        return m_navigation;
    }

    /**
     * Returns the HTML for an <code>&lt;img src="..." /&gt;</code> tag that includes the given image scaling parameters.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS
     * @param scaler the image scaler to use for scaling the image
     * @param attributes a map of additional HTML attributes that are added to the output
     * 
     * @return the HTML for an <code>&lt;img src&gt;</code> tag that includes the given image scaling parameters
     */
    public String img(String target, CmsImageScaler scaler, Map attributes) {

        return img(target, scaler, attributes, false);
    }

    /**
     * Returns the HTML for an <code>&lt;img src="..." /&gt;</code> tag that includes the given image scaling parameters.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS
     * @param scaler the image scaler to use for scaling the image
     * @param attributes a map of additional HTML attributes that are added to the output
     * @param partialTag if <code>true</code>, the opening <code>&lt;img</code> and closing <code> /&gt;</code> is omitted
     * 
     * @return the HTML for an <code>&lt;img src&gt;</code> tag that includes the given image scaling parameters
     */
    public String img(String target, CmsImageScaler scaler, Map attributes, boolean partialTag) {

        try {
            return CmsJspTagImage.imageTagAction(target, scaler, attributes, partialTag, getRequest());
        } catch (Throwable t) {
            handleException(t);
        }
        CmsMessageContainer msgContainer = Messages.get().container(
            Messages.GUI_ERR_IMG_SCALE_2,
            target,
            scaler == null ? "null" : scaler.toString());
        return getMessage(msgContainer);
    }

    /**
     * Include a sub-element without paramters from the OpenCms VFS, same as
     * using the <code>&lt;cms:include file="***" /&gt;</code> tag.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @throws JspException in case there were problems including the target
     *
     * @see org.opencms.jsp.CmsJspTagInclude
     */
    public void include(String target) throws JspException {

        include(target, null, null);
    }

    /**
     * Include a named sub-element without paramters from the OpenCms VFS, same as
     * using the <code>&lt;cms:include file="***" element="***" /&gt;</code> tag.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @param element the element (template selector) to display from the target
     * @throws JspException in case there were problems including the target
     *
     * @see org.opencms.jsp.CmsJspTagInclude
     */
    public void include(String target, String element) throws JspException {

        include(target, element, null);
    }

    /**
     * Include a named sub-element without paramters from the OpenCms VFS, same as
     * using the <code>&lt;cms:include file="***" element="***" /&gt;</code> tag.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @param element the element (template selector) to display from the target
     * @param editable flag to indicate if element is editable
     * @throws JspException in case there were problems including the target
     *
     * @see org.opencms.jsp.CmsJspTagInclude
     */
    public void include(String target, String element, boolean editable) throws JspException {

        include(target, element, editable, null);
    }

    /**
     * Include a named sub-element with paramters from the OpenCms VFS, same as
     * using the <code>&lt;cms:include file="***" element="***" /&gt;</code> tag
     * with parameters in the tag body.<p>
     * 
     * The parameter map should be a map where the keys are Strings 
     * (the parameter names) and the values are of type String[].
     * However, as a convenience feature,
     * in case you provide just a String for the parameter value, 
     * it will automatically be translated to a String[1].<p>
     * 
     * The handling of the <code>element</code> parameter depends on the 
     * included file type. Most often it is used as template selector.<p>
     * 
     * <b>Important:</b> Exceptions that occur in the include process are NOT
     * handled even if {@link #setSupressingExceptions(boolean)} was set to <code>true</code>.
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @param element the element (template selector) to display from the target
     * @param editable flag to indicate if element is editable
     * @param parameterMap a map of the request parameters
     * @throws JspException in case there were problems including the target
     * 
     * @see org.opencms.jsp.CmsJspTagInclude
     */
    public void include(String target, String element, boolean editable, Map parameterMap) throws JspException {

        if (isNotInitialized()) {
            return;
        }
        if (parameterMap != null) {
            try {
                HashMap modParameterMap = new HashMap(parameterMap.size());
                // ensure parameters are always of type String[] not just String
                Iterator i = parameterMap.keySet().iterator();
                while (i.hasNext()) {
                    String key = (String)i.next();
                    Object value = parameterMap.get(key);
                    if (value instanceof String[]) {
                        modParameterMap.put(key, value);
                    } else {
                        if (value == null) {
                            value = "null";
                        }
                        String[] newValue = new String[] {value.toString()};
                        modParameterMap.put(key, newValue);
                    }
                }
                parameterMap = modParameterMap;
            } catch (UnsupportedOperationException e) {
                // parameter map is immutable, just use it "as is"
            }
        }
        CmsJspTagInclude.includeTagAction(
            getJspContext(),
            target,
            element,
            editable,
            parameterMap,
            getRequest(),
            getResponse());
    }

    /**
     * Include a named sub-element with paramters from the OpenCms VFS, same as
     * using the <code>&lt;cms:include file="***" element="***" /&gt;</code> tag
     * with parameters in the tag body.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @param element the element (template selector) to display from the target
     * @param parameterMap a map of the request parameters
     * @throws JspException in case there were problems including the target
     * 
     * @see org.opencms.jsp.CmsJspTagInclude
     */
    public void include(String target, String element, Map parameterMap) throws JspException {

        include(target, element, false, parameterMap);
    }

    /**
     * Includes a named sub-element supressing all Exceptions that occur during the include,
     * otherwise the same as using {@link #include(String, String, Map)}.<p>
     * 
     * This is a convenience method that allows to include elements on a page without checking 
     * if they exist or not. If the target element does not exist, nothing is printed to 
     * the JSP output.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @param element the element (template selector) to display from the target
     */
    public void includeSilent(String target, String element) {

        try {
            include(target, element, null);
        } catch (Throwable t) {
            // ignore
        }
    }

    /**
     * Includes a named sub-element supressing all Exceptions that occur during the include,
     * otherwise the same as using {@link #include(String, String, Map)}.<p>
     * 
     * This is a convenience method that allows to include elements on a page without checking 
     * if they exist or not. If the target element does not exist, nothing is printed to 
     * the JSP output.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @param element the element (template selector) to display from the target
     * @param editable flag to indicate if element is editable
     */
    public void includeSilent(String target, String element, boolean editable) {

        try {
            include(target, element, editable, null);
        } catch (Throwable t) {
            // ignore
        }
    }

    /**
     * Includes a named sub-element supressing all Exceptions that occur during the include,
     * otherwise the same as using {@link #include(String, String, Map)}.<p>
     * 
     * This is a convenience method that allows to include elements on a page without checking 
     * if they exist or not. If the target element does not exist, nothing is printed to 
     * the JSP output.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @param element the element (template selector) to display from the target
     * @param editable flag to indicate if element is editable
     * @param parameterMap a map of the request parameters
     */
    public void includeSilent(String target, String element, boolean editable, Map parameterMap) {

        try {
            include(target, element, editable, parameterMap);
        } catch (Throwable t) {
            // ignore
        }
    }

    /**
     * Includes a named sub-element supressing all Exceptions that occur during the include,
     * otherwise the same as using {@link #include(String, String, Map)}.<p>
     * 
     * This is a convenience method that allows to include elements on a page without checking 
     * if they exist or not. If the target element does not exist, nothing is printed to 
     * the JSP output.<p>
     * 
     * @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
     * @param element the element (template selector) to display from the target
     * @param parameterMap a map of the request parameters
     */
    public void includeSilent(String target, String element, Map parameterMap) {

        try {
            include(target, element, parameterMap);
        } catch (Throwable t) {
            // ignore
        }
    }

    /**
     * Returns an OpenCms or JVM system info property value, same as using
     * the <code>&lt;cms:info property="***" /&gt;</code> tag.<p>
     * 
     * See the description of the class {@link CmsJspTagInfo} for a detailed list 
     * of available options for the property value.<p>
     *  
     * @param property the property to look up
     * @return String the value of the system property
     * @see org.opencms.jsp.CmsJspTagInfo
     */
    public String info(String property) {

        try {
            return CmsJspTagInfo.infoTagAction(property, getRequest());
        } catch (Throwable t) {
            handleException(t);
        }
        CmsMessageContainer msgContainer = Messages.get().container(Messages.GUI_ERR_INFO_PROP_READ_1, property);
        return getMessage(msgContainer);
    }

    /**
     * Returns an OpenCms workplace label.<p>
     * 
     * You should consider using a standard 
     * {@link java.util.ResourceBundle java.util.ResourceBundle} instead of the 
     * OpenCms workplace language files.
     * 
     * @param label the label to look up
     * @return label the value of the label
     * 
     * @see org.opencms.jsp.CmsJspTagLabel
     */
    public String label(String label) {

        if (isNotInitialized()) {
            return getMessage(NOT_INITIALIZED);

⌨️ 快捷键说明

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