public String getActualProgress() {

        try {
            CmsProgressThread thread;
            if (getProgressThread(getKey()) != null) {
                thread = m_threads.get(getKey());

                if (thread.isAlive()) {
                    // wait the configured time until to update the progress the first time
                    if (thread.getRuntime() < getShowWaitTime()) {
                        while ((thread.getRuntime() < getShowWaitTime()) && (thread.isAlive())) {
                            synchronized (this) {
                                wait(500);
                            }
                        }
                    } else {
                        // wait the configured refresh rate before returning
                        synchronized (this) {
                            wait(getRefreshRate());
                        }
                    }
                }

                if (!thread.isAlive()) {
                    // is an error occurred in the execution of the thread?
                    if (thread.getError() != null) {
                        return createError(
                            Messages.get().getBundle(getJsp().getRequestContext().getLocale()).key(
                                Messages.GUI_PROGRESS_ERROR_IN_THREAD_0),
                            thread.getError());
                    }

                    // return the result of the list created in the progress
                    return thread.getResult();
                }

                // create and return the actual progress in percent with the description to be shown
                StringBuffer result = new StringBuffer();

                result.append("PRO");
                result.append(thread.getProgress());
                result.append("%");
                result.append("|");
                result.append(thread.getDescription());

                return result.toString();
            } else {
                if (LOG.isErrorEnabled()) {
                    LOG.error(Messages.get().getBundle().key(Messages.LOG_PROGRESS_THREAD_NOT_FOUND_1, getKey()));
                }
                return createError(Messages.get().getBundle(getJsp().getRequestContext().getLocale()).key(
                    Messages.GUI_PROGRESS_THREAD_NOT_FOUND_1,
                    getKey()));
            }

        } catch (Throwable t) {
            if (LOG.isErrorEnabled()) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_PROGRESS_ERROR_CALC_PROGRESS_0), t);
            }
            return createError(
                Messages.get().getBundle(getJsp().getRequestContext().getLocale()).key(
                    Messages.GUI_PROGRESS_ERROR_CALCULATING_0),
                t);
        }
    }
public String getActualProgress ( ) { try { CmsProgressThread thread ; if ( getProgressThread ( getKey ( ) ) != null ) { thread = m_threads . get ( getKey ( ) ) ; if ( thread . isAlive ( ) ) { if ( thread . getRuntime ( ) < getShowWaitTime ( ) ) { while ( ( thread . getRuntime ( ) < getShowWaitTime ( ) ) && ( thread . isAlive ( ) ) ) { synchronized ( this ) { wait ( 500 ) ; } } } else { synchronized ( this ) { wait ( getRefreshRate ( ) ) ; } } } if ( ! thread . isAlive ( ) ) { if ( thread . getError ( ) != null ) { return createError ( Messages . get ( ) . getBundle ( getJsp ( ) . getRequestContext ( ) . getLocale ( ) ) . key ( Messages . GUI_PROGRESS_ERROR_IN_THREAD_0 ) , thread . getError ( ) ) ; } return thread . getResult ( ) ; } StringBuffer result = new StringBuffer ( ) ; result . append ( "PRO" ) ; result . append ( thread . getProgress ( ) ) ; result . append ( "%" ) ; result . append ( "|" ) ; result . append ( thread . getDescription ( ) ) ; return result . toString ( ) ; } else { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_PROGRESS_THREAD_NOT_FOUND_1 , getKey ( ) ) ) ; } return createError ( Messages . get ( ) . getBundle ( getJsp ( ) . getRequestContext ( ) . getLocale ( ) ) . key ( Messages . GUI_PROGRESS_THREAD_NOT_FOUND_1 , getKey ( ) ) ) ; } } catch ( Throwable t ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_PROGRESS_ERROR_CALC_PROGRESS_0 ) , t ) ; } return createError ( Messages . get ( ) . getBundle ( getJsp ( ) . getRequestContext ( ) . getLocale ( ) ) . key ( Messages . GUI_PROGRESS_ERROR_CALCULATING_0 ) , t ) ; } }
Returns the actual progress in percent.<p>

The return value depends on the state of the progress/thread. This can be
<ul>
<li>the actual progress in percent with an optional description.</li>
<li>the result as the html code for the list.</li>
<li>an error message.</li>
</ul><p>

The result will be interpreted by the JavaScript method "updateProgressbar()".<p>

@return the actual progress as a String