Returns the html code to build the lock dialog.<p>

@return html code

@throws CmsException if something goes wrong
12574
public String buildLockDialog() throws CmsException {

        CmsLockFilter nonBlockingFilter = CmsLockFilter.FILTER_ALL;
        nonBlockingFilter = nonBlockingFilter.filterLockableByUser(getCms().getRequestContext().getCurrentUser());
        nonBlockingFilter = nonBlockingFilter.filterSharedExclusive();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamProjectid())) {
            nonBlockingFilter = nonBlockingFilter.filterProject(new CmsUUID(getParamProjectid()));
        }
        return org.opencms.workplace.commons.CmsLock.buildLockDialog(
            this,
            nonBlockingFilter,
            getBlockingFilter(),
            0,
            true);
    }
645552
private CmsLock getParentLock(String resourcename) {

        CmsLock parentFolderLock = getParentFolderLock(resourcename);
        if (!parentFolderLock.isNullLock()) {
            return new CmsLock(
                resourcename,
                parentFolderLock.getUserId(),
                parentFolderLock.getProject(),
                CmsLockType.INHERITED);
        }
        return CmsLock.getNullLock();
    }
453559
public String buildDefaultConfirmationJS() {

        StringBuffer html = new StringBuffer(512);
        html.append("<script type='text/javascript'><!--\n");
        html.append("function setConfirmationMessage(locks, blockinglocks) {\n");
        html.append("\tvar confMsg = document.getElementById('conf-msg');\n");
        html.append("\tif (locks > -1) {\n");
        if (!getSettings().getUserSettings().getDialogShowLock()
            && (CmsLock.getDialogAction(getCms()) != CmsLock.TYPE_LOCKS)) {
            // auto commit if lock dialog disabled
            html.append("\t\tif (blockinglocks == 0) {\n");
            html.append("\t\t\tsubmitAction('");
            html.append(CmsDialog.DIALOG_OK);
            html.append("', null, 'main');\n");
            html.append("\t\t\tdocument.forms['main'].submit();\n");
            html.append("\t\t\treturn;\n");
            html.append("\t\t}\n");
        }
        html.append("\t\tdocument.getElementById('lock-body-id').className = '';\n");
        html.append("\t\tif (locks > '0') {\n");
        html.append("\t\t\tshowAjaxReportContent();\n");
        html.append("\t\t\tconfMsg.innerHTML = '");
        html.append(getConfirmationMessage(false));
        html.append("';\n");
        html.append("\t\t} else {\n");
        html.append("\t\t\tshowAjaxOk();\n");
        html.append("\t\t\tconfMsg.innerHTML = '");
        html.append(getConfirmationMessage(true));
        html.append("';\n");
        html.append("\t\t}\n");
        html.append("\t} else {\n");
        html.append("\t\tconfMsg.innerHTML = '");
        html.append(key(org.opencms.workplace.Messages.GUI_AJAX_REPORT_WAIT_0));
        html.append("';\n");
        html.append("\t}\n");
        html.append("}\n");
        html.append("// -->\n");
        html.append("</script>\n");
        return html.toString();
    }
1300091
private I_CmsSearchIndex getIndex() {

        I_CmsSearchIndex index = null;
        // get the configured index or the selected index
        if (isInitialCall()) {
            // the search form is in the initial state
            // get the configured index
            index = OpenCms.getSearchManager().getIndex(getSettings().getUserSettings().getWorkplaceSearchIndexName());
        } else {
            // the search form is not in the inital state, the submit button was used already or the
            // search index was changed already
            // get the selected index in the search dialog
            index = OpenCms.getSearchManager().getIndex(getJsp().getRequest().getParameter("indexName.0"));
        }
        return index;
    }
1113364
protected CmsObject getCms() {

        if (m_cms == null) {
            try {
                m_cms = OpenCms.initCmsObject(A_CmsUI.getCmsObject());
                m_cms.getRequestContext().setSiteRoot("");
            } catch (CmsException e) {
                return null;
            }
        }
        return m_cms;
    }
845478
protected void ensureLock() throws CmsException {

        CmsLock lock = m_cms.getLock(m_resource);
        if (lock.isUnlocked() || !lock.isLockableBy(m_cms.getRequestContext().getCurrentUser())) {
            m_cms.lockResourceTemporary(m_cms.getSitePath(m_resource));
            m_needToUnlock = true;
        }
    }
245880
public String getDialogTitle() {

        return OpenCms.getWorkplaceManager().getMessages(A_CmsUI.get().getLocale()).key(getDialogTitleKey());
    }
1019566
public String buildCheckboxEnableNotification() {

        String propVal = null;
        if (!isMultiOperation()) {
            // get current settings for single resource dialog
            try {
                propVal = getCms().readPropertyObject(
                    getParamResource(),
                    CmsPropertyDefinition.PROPERTY_ENABLE_NOTIFICATION,
                    false).getValue();
            } catch (CmsException e) {
                if (LOG.isInfoEnabled()) {
                    LOG.info(e.getLocalizedMessage());
                }
            }

        }
        if (CmsStringUtil.isEmpty(propVal)) {
            propVal = CmsStringUtil.FALSE;
        }
        StringBuffer result = new StringBuffer(512);
        result.append("<input type=\"checkbox\" style=\"text-align:left\" name=\"");
        result.append(PARAM_ENABLE_NOTIFICATION);
        if (Boolean.valueOf(propVal).booleanValue()) {
            result.append("\" checked=\"checked");
        }
        result.append("\" value=\"true\">");
        return result.toString();
    }
353714
protected String defaultActionHtml() {

        StringBuffer result = new StringBuffer(32);

        result.append(htmlStart());
        result.append(bodyStart(null));
        result.append(dialogStart());
        result.append(dialogContentStart(""));
        result.append("<form name=\"main\" class=\"nomargin\" action=\"");
        result.append(getJsp().link(getDialogReturnUri()));
        result.append("\" method=\"post\" onsubmit=\"submitAction('");
        result.append(DIALOG_OK);
        result.append("', null, 'main');\" enctype=\"multipart/form-data\">\n");
        result.append(paramsAsHidden());
        if (getParamFramename() == null) {
            result.append("<input type=\"hidden\" name=\"");
            result.append(PARAM_FRAMENAME);
            result.append("\" value=\"\">");
        }
        result.append(createDialogErrorMessage());
        result.append(dialogBlockStart(getStarttext()));
        result.append("<table border=\"0\" width=\"100%\">\n");
        result.append("<tr>\n\t<td style=\"white-space: nowrap;\" unselectable=\"on\">");
        result.append(getImportMessage());
        result.append(":</td>\n");
        result.append("\t<td class=\"maxwidth\">");
        result.append("<input type=\"file\" name=\"");
        result.append(PARAM_IMPORTFILE);
        result.append("\" class=\"maxwidth\" accept=\"application/zip\">");
        result.append("</td>\n</tr>");
        result.append(getAdditionalParameters());
        result.append("</table>\n");
        result.append(dialogBlockEnd());

        result.append(dialogContentEnd());
        result.append(dialogButtonsOkCancel());
        result.append("</form>\n");
        result.append(dialogEnd());
        result.append(bodyEnd());
        result.append(htmlEnd());
        return result.toString();
    }
630412
public String dialogLockButtons() {

        StringBuffer html = new StringBuffer(512);
        html.append("<div id='butClose' >\n");
        html.append(dialogButtonsClose());
        html.append("</div>\n");
        html.append("<div id='butContinue' class='hide' >\n");
        html.append(
            dialogButtons(
                new int[] {BUTTON_CONTINUE, BUTTON_CANCEL},
                new String[] {" onclick=\"submitAction('" + DIALOG_OK + "', form); form.submit();\"", ""}));
        html.append("</div>\n");
        return html.toString();
    }
174575
private CmsObject getCmsObject() {

        CmsObject cms;
        try {
            cms = OpenCms.initCmsObject(A_CmsUI.getCmsObject());
            //m_cms.getRequestContext().setSiteRoot("");
        } catch (CmsException e) {
            cms = A_CmsUI.getCmsObject();
        }
        return cms;
    }
1091202
public String defaultActionHtml() {

        String params = allParamsAsRequest();
        String titleUri = CmsEncoder.escapeXml(getJsp().getRequest().getParameter(PARAM_TITLE_URI));
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(titleUri)) {
            titleUri = CmsToolManager.ADMINVIEW_ROOT_LOCATION + "/list-title.jsp";
        }
        String titleSrc = getFrameSource("tool_title", getJsp().link(titleUri + "?" + params));
        String contentSrc = getFrameSource(
            "tool_content",
            getJsp().link(CmsToolManager.ADMINVIEW_ROOT_LOCATION + "/list-explorer.jsp") + "?" + params);
        StringBuffer html = new StringBuffer(1024);
        html.append("<!DOCTYPE html>\n");
        html.append("<html>\n");
        html.append("\t<head>\n");
        html.append("\t\t<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=\"").append(
            getEncoding()).append("\">\n");
        String uplink = "/opencms_a/opencms/system/workplace/views/admin/admin-main.jsp?path=/projects/files&action=initial&projectid=fa9f561f-be30-11e2-bac3-21ebf444feef&showexplorer=true";
        html.append(
            "<script type='text/javascript'>var uplink = \""
                + CmsStringUtil.escapeJavaScript(uplink)
                + "\";</script>\n");
        html.append("\t\t<title>\n");
        html.append(
            "\t\t\t").append(
                key(
                    org.opencms.workplace.Messages.GUI_LABEL_WPTITLE_1,
                    new Object[] {getSettings().getUser().getFullName()})).append("\n");
        html.append("\t\t</title>\n");
        html.append("\t</head>\n");
        html.append("\t<frameset rows='57,*' border='0' frameborder='0' framespacing='0'>\n");
        html.append("\t\t<frame ").append(titleSrc).append(" frameborder='0' border='0' noresize scrolling='no'>\n");
        html.append("\t\t<frame ").append(contentSrc).append(
            " frameborder='0' border='0' noresize scrolling='auto' framespacing='0' marginheight='2' marginwidth='2' >\n");
        html.append("\t</frameset>\n");
        html.append("</html>\n");
        return html.toString();
    }
377304
private String getResourcesHTML(CmsPublishJobBase job) throws CmsException {

        String ret = "";
        if (job instanceof CmsPublishJobEnqueued) {
            //job is enqueued ->go over publish list
            List<CmsResource> resources = ((CmsPublishJobEnqueued)job).getPublishList().getAllResources();
            for (CmsResource res : resources) {
                ret += res.getRootPath() + "<br/>";
            }
        } else {
            //job is running or finished
            List<CmsPublishedResource> resources = A_CmsUI.getCmsObject().readPublishedResources(
                job.getPublishHistoryId());
            for (CmsPublishedResource res : resources) {
                ret += res.getRootPath() + "<br/>";
            }
        }
        return ret;
    }
1078294
protected CmsLockInfo getLock(CmsUUID structureId) throws CmsException {

        CmsResource res = getCmsObject().readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION);
        return getLock(getCmsObject().getSitePath(res));
    }
1358071
public void readLocks() throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext();
        try {
            m_driverManager.readLocks(dbc);
        } finally {
            dbc.clear();
        }
    }
1297459
public String getNavText() {

        String navText = "";
        try {
            navText = getCms().readPropertyObject(
                getCms().getSitePath(m_resource),
                CmsPropertyDefinition.PROPERTY_NAVTEXT,
                false).getValue();
        } catch (Throwable e) {
            String storedSiteRoot = getCms().getRequestContext().getSiteRoot();
            try {
                getCms().getRequestContext().setSiteRoot("");
                navText = getCms().readPropertyObject(
                    m_resource.getRootPath(),
                    CmsPropertyDefinition.PROPERTY_NAVTEXT,
                    false).getValue();
            } catch (Exception e1) {
                // should usually never happen
                if (LOG.isInfoEnabled()) {
                    LOG.info(e);
                }
            } finally {
                getCms().getRequestContext().setSiteRoot(storedSiteRoot);
            }
        }
        if (navText == null) {
            navText = "";
        }
        return navText;
    }
1133286
private I_CmsXmlDocument getDocument() throws CmsException {

        if (m_document == null) {
            m_file = m_cms.readFile(m_resource);
            CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, m_file);
            m_document = content;
        }
        return m_document;
    }