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

📄 cmsreport.java

📁 cms是开源的框架
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     */
    public String getParamThread() {

        if ((m_paramThread != null) && (!m_paramThread.equals(CmsUUID.getNullUUID()))) {
            return m_paramThread.toString();
        } else {
            return null;
        }
    }

    /**
     * Returns if another report is following this report.<p>
     * 
     * @return <code>"true"</code> if another report is following this report
     */
    public String getParamThreadHasNext() {

        if (m_paramThreadHasNext == null) {
            m_paramThreadHasNext = "";
        }
        return m_paramThreadHasNext;
    }

    /**
     * Returns the part of the report that is ready for output.<p>
     * 
     * @return the part of the report that is ready for output
     */
    public String getReportUpdate() {

        A_CmsReportThread thread = OpenCms.getThreadStore().retrieveThread(m_paramThread);
        if (thread != null) {
            return thread.getReportUpdate();
        } else {
            return "";
        }
    }

    /**
     * Returns if the report generated an error output.<p>
     * 
     * @return true if the report generated an error, otherwise false
     */
    public boolean hasError() {

        A_CmsReportThread thread = OpenCms.getThreadStore().retrieveThread(m_paramThread);
        if (thread != null) {
            return thread.hasError();
        } else {
            return false;
        }
    }

    /**
     * Builds the start html of the page, including setting of DOCTYPE and 
     * inserting a header with the content-type.<p>
     * 
     * This overloads the default method of the parent class.<p>
     * 
     * @return the start html of the page
     */
    public String htmlStart() {

        return pageHtml(HTML_START, true);
    }

    /**
     * Builds the start html of the page, including setting of DOCTYPE and 
     * inserting a header with the content-type.<p>
     * 
     * This overloads the default method of the parent class.<p>
     * 
     * @param loadStyles if true, the defaul style sheet will be loaded
     * @return the start html of the page
     */
    public String htmlStart(boolean loadStyles) {

        return pageHtml(HTML_START, loadStyles);
    }

    /**
     * Returns true if the report Thread is still alive (i.e. running), false otherwise.<p>
     *  
     * @return true if the report Thread is still alive
     */
    public boolean isAlive() {

        A_CmsReportThread thread = OpenCms.getThreadStore().retrieveThread(m_paramThread);
        if (thread != null) {
            return thread.isAlive();
        } else {
            return false;
        }
    }

    /**
     * Checks whether this is a simple report.<p>
     * 
     * @return true, if the type of this report is a "simple"
     */
    public boolean isSimpleReport() {

        return getParamReportType().equalsIgnoreCase(I_CmsReport.REPORT_TYPE_SIMPLE);
    }

    /**
     * Builds the start html of the page, including setting of DOCTYPE and 
     * inserting a header with the content-type.<p>
     * 
     * This overloads the default method of the parent class.<p>
     * 
     * @param segment the HTML segment (START / END)
     * @param loadStyles if true, the defaul style sheet will be loaded
     * @return the start html of the page
     */
    public String pageHtml(int segment, boolean loadStyles) {

        if (useNewStyle()) {
            return super.pageHtml(segment, null, getParamTitle());
        }
        if (segment == HTML_START) {
            StringBuffer result = new StringBuffer(512);
            result.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n");
            result.append("<html>\n<head>\n");
            result.append("<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=");
            result.append(getEncoding());
            result.append("\">\n");
            if (loadStyles) {
                result.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
                result.append(getStyleUri(getJsp(), "workplace.css"));
                result.append("\">\n");
                result.append("<script type=\"text/javascript\">\n");
                result.append(dialogScriptSubmit());
                result.append("</script>\n");
            }
            return result.toString();
        } else {
            return "</html>";
        }

    }

    /**
     * Sets  if the workplace must be refreshed.<p>
     * 
     * @param value <code>"true"</code> (String) if the workplace must be refreshed.
     */
    public void setParamRefreshWorkplace(String value) {

        m_paramRefreshWorkplace = value;
    }

    /**
     * Sets the key name which contains the localized message for the continue checkbox.<p>
     * 
     * @param key the key name which contains the localized message for the continue checkbox
     */
    public void setParamReportContinueKey(String key) {

        m_paramReportContinueKey = key;
    }

    /**
     * Sets the type of this report.<p>
     * 
     * @param value the type of this report
     */
    public void setParamReportType(String value) {

        m_paramReportType = value;
    }

    /**
     * Sets the Thread id to display in this report.<p>
     * 
     * @param value the Thread id to display in this report
     */
    public void setParamThread(String value) {

        m_paramThread = CmsUUID.getNullUUID();
        if (value != null) {
            try {
                m_paramThread = new CmsUUID(value);
            } catch (Exception e) {
                // can usually be ignored
                if (LOG.isInfoEnabled()) {
                    LOG.info(
                        Messages.get().getBundle().key(Messages.LOG_THREAD_CREATION_FAILED_1, new Integer(value)),
                        e);
                }
            }
        }
    }

    /**
     * Sets if another report is following this report.<p>
     * 
     * @param value <code>"true"</code> if another report is following this report
     */
    public void setParamThreadHasNext(String value) {

        m_paramThreadHasNext = value;
    }

    /**
     * @see org.opencms.workplace.CmsWorkplace#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
     */
    protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request) {

        // fill the parameter values in the get/set methods
        fillParamValues(request);
        // set the action for the JSP switch 
        if (REPORT_UPDATE.equals(getParamAction())) {
            setAction(ACTION_REPORT_UPDATE);
        } else {
            setAction(ACTION_REPORT_BEGIN);
        }
    }

    /**
     * Returns always true and does nothing else, has to be implemented.<p>
     * 
     * @see org.opencms.workplace.CmsMultiDialog#performDialogOperation()
     */
    protected boolean performDialogOperation() {

        // do nothing, has to be implemented
        return true;
    }

}

⌨️ 快捷键说明

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