/** * Sets the structure id of the edit resource.<p> * * @param editId the structure id of the edit resource */ public void setEditId(String editId) { m_editId = CmsStringUtil.isEmptyOrWhitespaceOnly(editId) ? null : editId; }
/** * Sets the page context attribute name for the form error message.<p> * * @param error the page context attribute name for the form error message */ public void setError(String error) { m_error = CmsStringUtil.isEmptyOrWhitespaceOnly(error) ? null : error; }
/** * Sets the page context attribute name for the form session id.<p> * * @param var page context attribute name for the form session id */ public void setVar(String var) { m_var = CmsStringUtil.isEmptyOrWhitespaceOnly(var) ? null : var; }
/** * Returns if the represented resource is editable by the current user.<p> * * @return <code>true</code> if editable */ public boolean isEditable() { return CmsStringUtil.isEmptyOrWhitespaceOnly(m_noEditReson); }
/** * Creates an OpenCms XML error handler with a resource name for error logging.<p> * * @param resourceName the name (path) of the XML resource that is handled, for logging */ public CmsXmlErrorHandler(String resourceName) { if (!CmsStringUtil.isEmptyOrWhitespaceOnly(resourceName)) { m_resourceName = " " + resourceName; } else { m_resourceName = ""; } }
/** * Returns the maxElements attribute value.<p> * * @return the maxElements attribute value */ public String getMaxElements() { return CmsStringUtil.isEmptyOrWhitespaceOnly(m_maxElements) ? DEFAULT_MAX_ELEMENTS : m_maxElements; }
/** * Sets the file name of the edit resource.<p> * * @param editName the file name of the edit resource */ public void setEditName(String editName) { m_editName = CmsStringUtil.isEmptyOrWhitespaceOnly(editName) ? null : editName; }
/** * Returns the originally requested workplace resource path parameter.<p> * * @return the originally requested workplace resource path parameter */ public String getParamWpres() { if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_paramWpres) || "null".equals(m_paramWpres)) { return CmsWorkplace.JSP_WORKPLACE_URI; } return m_paramWpres; }
/** * @see org.opencms.loader.I_CmsTemplateContextProvider#initialize(org.opencms.file.CmsObject, java.lang.String) */ public void initialize(CmsObject cms, String config) { m_cms = cms; if (CmsStringUtil.isEmptyOrWhitespaceOnly(config)) { m_params = new HashMap<String, String>(); } else { m_params = CmsStringUtil.splitAsMap(config, ",", "="); } getAllContexts(); }
/** * Returns the show editor help flag.<p> * * @param cms the cms context * * @return the show editor help flag */ public boolean isShowEditorHelp(CmsObject cms) { CmsUser user = cms.getRequestContext().getCurrentUser(); String showHelp = (String)user.getAdditionalInfo(ADDINFO_ADE_SHOW_EDITOR_HELP); return CmsStringUtil.isEmptyOrWhitespaceOnly(showHelp) || Boolean.parseBoolean(showHelp); }
/** * @see org.opencms.security.I_CmsValidationHandler#checkLastname(java.lang.String) */ public void checkLastname(String lastname) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(lastname)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_LASTNAME_EMPTY_0)); } }
/** * Sets the description of this organizational unit.<p> * * @param description the principal organizational unit to set */ public void setDescription(String description) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(description)) { throw new CmsIllegalArgumentException( org.opencms.db.Messages.get().container(org.opencms.db.Messages.ERR_BAD_OU_DESCRIPTION_EMPTY_0)); } m_description = description; }
/** * Sets the editor label key used for the localized nice name.<p> * * @param label the editor label key used for the localized nice name */ private void setEditorLabel(String label) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(label)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_LABEL_0)); } m_editorLabel = label; }
/** * Throws a runtime exception if name is empty.<p> * * @param name the project name to check */ public static void checkProjectName(String name) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_PROJECTNAME_VALIDATION_0)); } }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (resourceUtil[0].isInsideProject()) { return (!resourceUtil[0].getProjectState().isLockedForPublishing()) && (CmsStringUtil.isEmptyOrWhitespaceOnly(resourceUtil[0].getLockedByName())); } // resource is not in current project return false; }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (resourceUtil[0].isInsideProject()) { return (!resourceUtil[0].getProjectState().isLockedForPublishing()) && (CmsStringUtil.isEmptyOrWhitespaceOnly(resourceUtil[0].getLockedByName())); } // resource is not in current project return false; }
/** * Sets the message to display.<p> * * @param message the message to set */ public void setMessage(String message) { checkFrozen(); if (isEnabled() && CmsStringUtil.isEmptyOrWhitespaceOnly(message)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_LOGIN_MESSAGE_BAD_MESSAGE_0)); } m_message = message; }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (resourceUtil[0].isInsideProject()) { boolean matches = (!resourceUtil[0].getProjectState().isLockedForPublishing()) && (CmsStringUtil.isEmptyOrWhitespaceOnly(resourceUtil[0].getLockedByName())); return matches && !OpenCms.getWorkplaceManager().autoLockResources(); } // resource is not in current project return false; }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (resourceUtil[0].isInsideProject()) { boolean matches = (!resourceUtil[0].getProjectState().isLockedForPublishing()) && (CmsStringUtil.isEmptyOrWhitespaceOnly(resourceUtil[0].getLockedByName())); return matches && !OpenCms.getWorkplaceManager().autoLockResources(); } // resource is not in current project return false; }
/** * Returns if the current lock state allows editing.<p> * * @return <code>true</code> if the resource is editable */ public boolean isEditable() { return m_permissionInfo.hasWritePermission() && CmsStringUtil.isEmptyOrWhitespaceOnly(getNoEditReason()) && !hasForeignFolderLock() && !hasBlockingLockedChildren() && (((getLock() == null) || (getLock().getLockOwner() == null)) || getLock().isOwnedByUser()); }