Returns true, if there exists an editor for a specific resource.<p>

@param resource the resource to check if there exists an editor

@return true if there exists an editor for the resource
357744
public static boolean existsEditor(CmsResource resource) {

        int plainId;
        try {
            plainId = OpenCms.getResourceManager().getResourceType(
                CmsResourceTypePlain.getStaticTypeName()).getTypeId();
        } catch (CmsLoaderException e) {
            // this should really never happen
            plainId = CmsResourceTypePlain.getStaticTypeId();
        }
        if ((CmsResourceTypeJsp.isJsp(resource))
            || (resource.getTypeId() == plainId)
            || CmsResourceTypeXmlPage.isXmlPage(resource)) {
            return true;
        }
        return false;
    }
921334
public static boolean isResourceTypeIdFree(int id) {

        try {
            OpenCms.getResourceManager().getResourceType(id);
        } catch (CmsLoaderException e) {
            return true;
        }
        return false;
    }
624935
@Override
    public CmsDirectEditResourceInfo getResourceInfo(String resourceName) {

        try {
            // first check some simple preconditions for direct edit
            if (m_cms.getRequestContext().getCurrentProject().isOnlineProject()) {
                // don't show direct edit button in online project
                return CmsDirectEditResourceInfo.INACTIVE;
            }
            if (CmsResource.isTemporaryFileName(resourceName)) {
                // don't show direct edit button on a temporary file
                return CmsDirectEditResourceInfo.INACTIVE;
            }
            if (!m_cms.isInsideCurrentProject(resourceName)) {
                // don't show direct edit button on files not belonging to the current project
                return CmsDirectEditResourceInfo.INACTIVE;
            }
            // read the target resource
            CmsResource resource = m_cms.readResource(resourceName, CmsResourceFilter.ALL);
            if (!OpenCms.getResourceManager().getResourceType(resource.getTypeId()).isDirectEditable()
                && !resource.isFolder()) {
                // don't show direct edit button for non-editable resources
                return CmsDirectEditResourceInfo.INACTIVE;
            }
            // check the resource lock
            CmsLock lock = m_cms.getLock(resource);
            boolean locked = !(lock.isUnlocked()
                || lock.isOwnedInProjectBy(
                    m_cms.getRequestContext().getCurrentUser(),
                    m_cms.getRequestContext().getCurrentProject()));
            // check the users permissions on the resource
            // only if write permissions are granted the resource may be direct editable
            if (locked) {
                // a locked resource must be shown as "disabled"
                return new CmsDirectEditResourceInfo(CmsDirectEditPermissions.DISABLED, resource, lock);
            }
            // if we have write permission and the resource is not locked then direct edit is enabled
            return new CmsDirectEditResourceInfo(CmsDirectEditPermissions.ENABLED, resource, lock);

        } catch (Exception e) {
            // all exceptions: don't mix up the result HTML, always return INACTIVE mode
            if (LOG.isWarnEnabled()) {
                LOG.warn(
                    org.opencms.workplace.editors.Messages.get().getBundle().key(
                        org.opencms.workplace.editors.Messages.LOG_CALC_EDIT_MODE_FAILED_1,
                        resourceName),
                    e);
            }
        }
        // otherwise the resource is not direct editable
        return CmsDirectEditResourceInfo.INACTIVE;
    }
275372
public boolean isAvailable(String resource) {
        final boolean isAnyTraceEnabled = com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled();
        if (isAnyTraceEnabled && logger.isLoggable(Level.FINER)) {
            logger.entering(CLASS_NAME, "isAvailable", "resource [" + resource + "] ");
        } //d651265
        boolean available = false;
        // not sure if needed; after first check for isAvailable, welcome file
        // goes directly to wrapper; can this ever be true?
        RequestProcessor rp = extensionContext.getMappingTarget(resource);
        available = (rp instanceof IServletWrapper); // true if wrapper has
                                                     // already been created.

        if (available == false) {
            if (jspOptions.isDisableJspRuntimeCompilation() == false) {
                try {
                    available = handleCaseSensitivityCheck(resource, false); //PK81387 - passing false
                } catch (IOException io) {
                    available = false;
                }
            } else {
                JspInputSource inputSource = context.getJspInputSourceFactory().createJspInputSource(resource);
                JspResources jspResources = context.getJspResourcesFactory().createJspResources(inputSource);

                String classname = jspResources.getClassName();
                String generatedSourceDir = jspResources.getGeneratedSourceFile().getParent();
                if (generatedSourceDir.endsWith(File.separator) == false) {
                    generatedSourceDir = generatedSourceDir + File.separator;
                }
                File tempDirJSP = new File(generatedSourceDir + classname + ".class");
                available = tempDirJSP.exists();

                if (available == false) {

                    String jspUri = inputSource.getRelativeURL();
                    if (jspUri.charAt(0) != '/') {
                        jspUri = "/" + jspUri;
                    }
                    String webinfClassFilePath = null;
                    File webinfClassFile = null;
                    String packageName = null;
                    if (jspOptions.isUseFullPackageNames() == false) {
                        webinfClassFilePath = context.getRealPath("/WEB-INF/classes") + jspUri.substring(0, jspUri.lastIndexOf("/") + 1);
                        webinfClassFile = new File(webinfClassFilePath + File.separator + classname + ".class");
                    } else {
                        packageName = jspResources.getPackageName();
                        String packageDir = packageName.replace('.', '/');
                        webinfClassFilePath = context.getRealPath("/WEB-INF/classes") + "/" + packageDir;
                        webinfClassFile = new File(webinfClassFilePath + File.separator + classname + ".class");
                    }
                    available = webinfClassFile.exists();
                }
            }
        }
        if (isAnyTraceEnabled && logger.isLoggable(Level.FINE)) {
            logger.exiting(CLASS_NAME, "isAvailable", "resource [" + resource + "] is available? [" + available + "]");
        } //d651265
        return available;

    }
938913
protected boolean isSarlResource(Object resource) {
		if (resource instanceof IFile) {
			final IFile file = (IFile) resource;
			return getFileExtensions().contains(file.getFileExtension());
		}
		return false;
	}
743288
public List<CmsVariationBean> getVariations(String resource) {

        List<String> ret = (List<String>)(m_filePaths.get(resource));
        List<CmsVariationBean> res = new ArrayList<CmsVariationBean>();
        if (ret == null) {
            return new ArrayList<CmsVariationBean>();
        }
        for (String r : ret) {
            res.add(new CmsVariationBean(r));
        }
        return res;
    }
1063706
public boolean checkResource(String resource, Action action, OrientPermission[] permissions)
	{
		String actionName = action.getName();
		int actionIndx = resource.indexOf(':');
		if(actionIndx>0) {
			if(!(resource.endsWith(actionName) && resource.length()>actionName.length() 
					&& resource.charAt(resource.length()-actionName.length()-1) == ':')) return true;
			else resource = resource.substring(0, actionIndx);//Should cut off action
		} else if(!Component.RENDER.equals(action)) return true; //Default suffix is for render: so other should be skipped
		
		OSecurityUser user = OrientDbWebSession.get().getUser();
		if(user==null) return false;
		ORule.ResourceGeneric generic = OSecurityHelper.getResourceGeneric(resource);
		String specific = OSecurityHelper.getResourceSpecific(resource);
		
		return user!=null
				?user.checkIfAllowed(generic, specific, OrientPermission.combinedPermission(permissions))!=null
				:false;
	}
267762
Boolean isResource(String resource) {
		Boolean isResource = false;
		if (!utils.isIdentifier(resource)) {
			try {
				String clazz = getControllerClass(resource);
				if (clazz != null) {
					Class.forName(clazz);
					isResource = true;
				}
			} catch (ClassNotFoundException e) {
				// It isn't a resource because there isn't a controller for it
			}
		}
		return isResource;
	}
559901
protected boolean isOperationOnFolder() {

        Iterator<String> i = getResourceList().iterator();
        while (i.hasNext()) {
            String resName = i.next();
            try {
                CmsResource curRes = getCms().readResource(resName, CmsResourceFilter.ALL);
                if (curRes.isFolder()) {
                    // found a folder
                    return true;
                }
            } catch (CmsException e) {
                // can usually be ignored
                if (LOG.isInfoEnabled()) {
                    LOG.info(e.getLocalizedMessage());
                }
            }
        }
        return false;
    }
107045
public function hasResource($resource) {

		if(null !== $resource && false === is_string($resource)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($resource)), E_USER_ERROR);
		}

		return true === array_key_exists($resource, $this -> resources);
	}
450750
public static boolean isFile(Resource resource) {
        return resource.isResourceType(ResourceUtil.TYPE_FILE) ||
                resource.isResourceType(ResourceUtil.TYPE_LINKED_FILE);
    }
638495
public static boolean isFile(Resource resource) {
        Node node = resource.adaptTo(Node.class);
        if (node != null) {
            try {
                NodeType type = node.getPrimaryNodeType();
                if (type != null) {
                    String typeName = type.getName();
                    switch (typeName) {
                        case TYPE_FILE:
                            return true;
                        case TYPE_RESOURCE:
                        case TYPE_UNSTRUCTURED:
                            try {
                                Property mimeType = node.getProperty(PROP_MIME_TYPE);
                                if (mimeType != null && StringUtils.isNotBlank(mimeType.getString())) {
                                    node.getProperty(ResourceUtil.PROP_DATA);
                                    // PathNotFountException if not present
                                    return true;
                                }
                            } catch (PathNotFoundException pnfex) {
                                // ok, was a check only
                            }
                            break;
                    }
                }
            } catch (RepositoryException e) {
                LOG.error(e.getMessage(), e);
            }
        }
        return false;
    }
1199064
public static boolean isFolder(String resource) {

        return CmsStringUtil.isNotEmpty(resource) && (resource.charAt(resource.length() - 1) == '/');
    }
434795
public static boolean isResourceTypeNameFree(String name) {

        try {
            OpenCms.getResourceManager().getResourceType(name);
        } catch (CmsLoaderException e) {
            return true;
        }
        return false;
    }
578005
public void add(CmsResource resource) {

        if (!m_processedIds.contains(resource.getStructureId())) {
            m_resources.add(resource);
            m_processedIds.add(resource.getStructureId());
            m_changed |= !(resource.getState().isUnchanged());
        }
    }
1338327
public static boolean isNavLevelFolder(CmsObject cms, CmsResource resource) {

        if (resource.isFolder()) {
            I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource);
            if (CmsResourceTypeFolder.RESOURCE_TYPE_NAME.equals(type.getTypeName())) {
                try {
                    CmsProperty prop = cms.readPropertyObject(
                        resource,
                        CmsPropertyDefinition.PROPERTY_DEFAULT_FILE,
                        false);
                    return !prop.isNullProperty() && NAVIGATION_LEVEL_FOLDER.equals(prop.getValue());
                } catch (CmsException e) {
                    LOG.debug(e.getMessage(), e);
                }
            }
        }
        return false;
    }
402704
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);
    }