@Override
    protected void initContent() {

        // save initialized instance of this class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
        // get the default encoding
        String content = getParamContent();
        if (CmsStringUtil.isNotEmpty(content)) {
            // content already read, must be decoded
            setParamContent(decodeContent(content));
            return;
        } else {
            content = "";
        }

        try {
            // lock resource if autolock is enabled
            checkLock(getParamResource());
            CmsFile editFile = getCms().readFile(getParamResource(), CmsResourceFilter.ALL);
            content = CmsEncoder.createString(editFile.getContents(), getFileEncoding());
        } catch (CmsException e) {
            // reading of file contents failed, show error dialog
            try {
                showErrorPage(this, e);
            } catch (JspException exc) {
                // should usually never happen
                if (LOG.isInfoEnabled()) {
                    LOG.info(exc);
                }
            }
        }
        setParamContent(content);
    }
@ Override protected void initContent ( ) { getJsp ( ) . getRequest ( ) . setAttribute ( SESSION_WORKPLACE_CLASS , this ) ; String content = getParamContent ( ) ; if ( CmsStringUtil . isNotEmpty ( content ) ) { setParamContent ( decodeContent ( content ) ) ; return ; } else { content = "" ; } try { checkLock ( getParamResource ( ) ) ; CmsFile editFile = getCms ( ) . readFile ( getParamResource ( ) , CmsResourceFilter . ALL ) ; content = CmsEncoder . createString ( editFile . getContents ( ) , getFileEncoding ( ) ) ; } catch ( CmsException e ) { try { showErrorPage ( this , e ) ; } catch ( JspException exc ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( exc ) ; } } } setParamContent ( content ) ; }
Initializes the editor content when opening the editor for the first time.<p>