/** * Checks if a path is filtered out of the filter or not.<p> * * @param path the path of a resource to check * @return true if the name matches one of the given filter patterns */ protected boolean isFiltered(String path) { // filter all temporary files if (CmsResource.isTemporaryFileName(path)) { return true; } if (m_filter == null) { return false; } return m_filter.isFiltered(path); }
/** * Checks whether a given combination of path and resource type belongs to an inherited container configuration file.<p> * * @param rootPath the root path of the resource * @param type the type id of the resource * * @return true if the given root path / type combination matches an inherited container configuration file */ protected boolean isContainerConfiguration(String rootPath, int type) { return OpenCms.getResourceManager().matchResourceType( CmsResourceTypeXmlContainerPage.INHERIT_CONTAINER_CONFIG_TYPE_NAME, type) && !CmsResource.isTemporaryFileName(rootPath) && rootPath.endsWith("/" + INHERITANCE_CONFIG_FILE_NAME); }
/** * Returns <code>true</code> if this navigation element is in the navigation, * <code>false</code> otherwise.<p> * * A resource is considered to be in the navigation, if <ol> * <li>it has the property PROPERTY_NAVTEXT set * <li><em>or</em> it has the property PROPERTY_NAVPOS set * <li><em>and</em> it is not a temporary file as defined by {@link CmsResource#isTemporaryFileName(String)}.</ol> * * @return <code>true</code> if this navigation element is in the navigation, <code>false</code> otherwise */ public boolean isInNavigation() { if (m_hasNav == null) { // use "lazy initializing" Object o1 = getProperties().get(CmsPropertyDefinition.PROPERTY_NAVTEXT); Object o2 = getProperties().get(CmsPropertyDefinition.PROPERTY_NAVPOS); m_hasNav = Boolean.valueOf(((o1 != null) || (o2 != null)) && !CmsResource.isTemporaryFileName(m_sitePath)); } return m_hasNav.booleanValue(); }
/** * @see org.opencms.search.I_CmsIndexer#deleteResources(org.opencms.search.I_CmsIndexWriter, java.util.List) */ public void deleteResources(I_CmsIndexWriter indexWriter, List<CmsPublishedResource> resourcesToDelete) { if ((resourcesToDelete == null) || resourcesToDelete.isEmpty()) { // nothing to delete return; } // contains all resources already deleted to avoid multiple deleting in case of siblings List<CmsUUID> resourcesAlreadyDeleted = new ArrayList<CmsUUID>(resourcesToDelete.size()); Iterator<CmsPublishedResource> i = resourcesToDelete.iterator(); while (i.hasNext()) { // iterate all resources in the given list of resources to delete CmsPublishedResource res = i.next(); if (!resourcesAlreadyDeleted.contains(res.getStructureId())) { // ensure siblings are only deleted once per update resourcesAlreadyDeleted.add(res.getStructureId()); if (!res.isFolder() && !CmsResource.isTemporaryFileName(res.getRootPath())) { // now delete the resource from the index deleteResource(indexWriter, res); } } } }
/** * Returns <code>true</code> if this resource is a temporary file.<p> * * A resource is considered a temporary file it is a file where the * {@link CmsResource#FLAG_TEMPFILE} flag has been set, or if the file name (without parent folders) * starts with the prefix char <code>'~'</code> (tilde).<p> * * @return <code>true</code> if the given resource name is a temporary file * * @see #isTemporaryFileName(String) */ public boolean isTemporaryFile() { return isFile() && (((getFlags() & CmsResource.FLAG_TEMPFILE) > 0) || isTemporaryFileName(getName())); }
/** * Returns <code>true</code> if the given resource is a temporary file.<p> * * A resource is considered a temporary file it is a file where the * {@link CmsResource#FLAG_TEMPFILE} flag has been set, or if the file name (without parent folders) * starts with the prefix char <code>'~'</code> (tilde).<p> * * @param resource the resource name to check * * @return <code>true</code> if the given resource name is a temporary file * * @see #getTemporaryFileName(String) * @see CmsResource#isTemporaryFileName(String) */ public static boolean isTemporaryFile(CmsResource resource) { return (resource != null) && ((resource.isFile() && (((resource.getFlags() & CmsResource.FLAG_TEMPFILE) > 0) || (CmsResource.isTemporaryFileName(resource.getName()))))); }
CmsPublishedResource res = i.next(); CmsResource resource = null; if (!CmsResource.isTemporaryFileName(res.getRootPath())) { try { resource = m_cms.readResource(res.getRootPath(), CmsResourceFilter.IGNORE_EXPIRATION);
/** * Contains the visibility handler configuration for a content field path.<p> */ protected static class VisibilityConfiguration { /** The handler instance. */ private I_CmsXmlContentVisibilityHandler m_handler; /** The handler configuration parameters. */ private String m_params; /** * Constructor.<p> * * @param handler the handler instance * @param params the handler configuration parameteres */ protected VisibilityConfiguration(I_CmsXmlContentVisibilityHandler handler, String params) { m_handler = handler; m_params = params; } /** * Returns the visibility handler instance.<p> * * @return the handler instance */ public I_CmsXmlContentVisibilityHandler getHandler() {
/** * Checks if an update of the formatter is needed and if so, adds its structure id to the update set.<p> * * @param structureId the structure id of the formatter * @param path the path of the formatter * @param resourceType the resource type */ private void checkIfUpdateIsNeeded(CmsUUID structureId, String path, int resourceType) { if (CmsResource.isTemporaryFileName(path)) { return; } if (OpenCms.getResourceManager().matchResourceType(TYPE_FORMATTER_CONFIG, resourceType) || OpenCms.getResourceManager().matchResourceType(TYPE_MACRO_FORMATTER, resourceType)) { markForUpdate(structureId); } }
/** * Removes the cache entry for the given resource data.<p> * * @param structureId the resource structure id * @param rootPath the resource root path * @param type the resource type */ protected void remove(CmsUUID structureId, String rootPath, int type) { if (CmsResource.isTemporaryFileName(rootPath)) { return; } m_pathCache.remove(structureId); if (isSitemapConfiguration(rootPath, type)) { m_updateSet.add(structureId); } else if (isModuleConfiguration(rootPath, type)) { m_updateSet.add(ID_UPDATE_MODULES); } else if (isElementView(type)) { m_updateSet.add(ID_UPDATE_ELEMENT_VIEWS); } else if (m_state.getFolderTypes().containsKey(rootPath)) { m_updateSet.add(ID_UPDATE_FOLDERTYPES); } }
setAction(ACTION_EDIT); String resName = CmsResource.getName(getParamResource()); if (CmsResource.isTemporaryFileName(resName)) { resName = resName.substring(1);
if (CmsResource.isTemporaryFileName(file.getRootPath())) { String originalFileName = CmsResource.getFolderPath(file.getRootPath()) + CmsResource.getName(file.getRootPath()).substring(CmsResource.TEMP_FILE_PREFIX.length());
if (CmsResource.isTemporaryFileName(rootPath)) { return;
if (CmsResource.isTemporaryFileName(cms.getRequestContext().getUri())) {
/** * Checks if the current request should be direct edit enabled.<p> * * @param req the servlet request * * @return <code>true</code> if the current request should be direct edit enabled */ public static boolean isEditableRequest(ServletRequest req) { boolean result = false; if (CmsHistoryResourceHandler.isHistoryRequest(req) || CmsJspTagEnableAde.isDirectEditDisabled(req)) { // don't display direct edit buttons on an historical resource result = false; } else { CmsFlexController controller = CmsFlexController.getController(req); CmsObject cms = controller.getCmsObject(); result = !cms.getRequestContext().getCurrentProject().isOnlineProject() && !CmsResource.isTemporaryFileName(cms.getRequestContext().getUri()); } return result; }
if (CmsResource.isTemporaryFileName(resourceName)) {