/** * Checks if the full resource name (including the site root) of a resource matches * any of the project resources of a project.<p> * * @param projectResources a List of project resources as Strings * @param resource the resource to check * @return true, if the resource is "inside" the project resources */ public static boolean isInsideProject(List projectResources, CmsResource resource) { String resourcename = resource.getRootPath(); return isInsideProject(projectResources, resourcename); }
/** * Checks if the full resource name (including the site root) of a resource matches * any of the project resources of a project.<p> * * @param projectResources a List of project resources as Strings * @param resource the resource to check * @return true, if the resource is "inside" the project resources */ public static boolean isInsideProject(List<String> projectResources, CmsResource resource) { String resourcename = resource.getRootPath(); return isInsideProject(projectResources, resourcename); }
/** * Returns <code>true</code> if the given resource is in the reference project.<p> * * Returns <code>false</code> if the request context is <code>null</code>.<p> * * @return <code>true</code> if the given resource is in the reference project * * @see #getReferenceProject() */ public boolean isInsideProject() { return CmsProject.isInsideProject(getProjectResources(), getResource()); }
/** * Returns <code>true</code> if the given resource is in the reference project.<p> * * Returns <code>false</code> if the request context is <code>null</code>.<p> * * @return <code>true</code> if the given resource is in the reference project * * @see #getReferenceProject() */ public boolean isInsideProject() { return CmsProject.isInsideProject(getProjectResources(), getResource()); }
/** * @see org.opencms.search.I_CmsIndexer#getUpdateData(org.opencms.search.CmsSearchIndexSource, java.util.List) */ public CmsSearchIndexUpdateData getUpdateData( CmsSearchIndexSource source, List<CmsPublishedResource> publishedResources) { // create a new update collection from this indexer and the given index source CmsSearchIndexUpdateData result = new CmsSearchIndexUpdateData(source, this); Iterator<CmsPublishedResource> i = publishedResources.iterator(); while (i.hasNext()) { // check all published resources if they match this indexer / source CmsPublishedResource pubRes = i.next(); // VFS resources will always have a structure id if (!pubRes.getStructureId().isNullUUID()) { // use utility method from CmsProject to check if published resource is "inside" this index source if (CmsProject.isInsideProject(source.getResourcesNames(), pubRes.getRootPath())) { // the resource is "inside" this index source addResourceToUpdateData(pubRes, result); } } } return result; }
/** * @see org.opencms.search.I_CmsIndexer#getUpdateData(org.opencms.search.CmsSearchIndexSource, java.util.List) */ public CmsSearchIndexUpdateData getUpdateData( CmsSearchIndexSource source, List<CmsPublishedResource> publishedResources) { // create a new update collection from this indexer and the given index source CmsSearchIndexUpdateData result = new CmsSearchIndexUpdateData(source, this); Iterator<CmsPublishedResource> i = publishedResources.iterator(); while (i.hasNext()) { // check all published resources if they match this indexer / source CmsPublishedResource pubRes = i.next(); // VFS resources will always have a structure id if (!pubRes.getStructureId().isNullUUID()) { // use utility method from CmsProject to check if published resource is "inside" this index source if (CmsProject.isInsideProject(source.getResourcesNames(), pubRes.getRootPath())) { // the resource is "inside" this index source addResourceToUpdateData(pubRes, result); } } } return result; }
/** * Checks if the specified resource is inside the current project.<p> * * The project "view" is determined by a set of path prefixes. * If the resource starts with any one of this prefixes, it is considered to * be "inside" the project.<p> * * @param dbc the current database context * @param resourcename the specified resource name (full path) * * @return <code>true</code>, if the specified resource is inside the current project */ public boolean isInsideCurrentProject(CmsDbContext dbc, String resourcename) { List projectResources = null; try { projectResources = readProjectResources(dbc, dbc.currentProject()); } catch (CmsException e) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key( Messages.LOG_CHECK_RESOURCE_INSIDE_CURRENT_PROJECT_2, resourcename, dbc.currentProject().getName()), e); } return false; } return CmsProject.isInsideProject(projectResources, resourcename); }
/** * Checks if the specified resource is inside the current project.<p> * * The project "view" is determined by a set of path prefixes. * If the resource starts with any one of this prefixes, it is considered to * be "inside" the project.<p> * * @param dbc the current database context * @param resourcename the specified resource name (full path) * * @return <code>true</code>, if the specified resource is inside the current project */ public boolean isInsideCurrentProject(CmsDbContext dbc, String resourcename) { List<String> projectResources = null; try { projectResources = readProjectResources(dbc, dbc.currentProject()); } catch (CmsException e) { if (LOG.isErrorEnabled()) { LOG.error( Messages.get().getBundle().key( Messages.LOG_CHECK_RESOURCE_INSIDE_CURRENT_PROJECT_2, resourcename, dbc.currentProject().getName()), e); } return false; } return CmsProject.isInsideProject(projectResources, resourcename); }
if (CmsProject.isInsideProject(source.getResourcesNames(), pubRes.getRootPath())) {
if (CmsProject.isInsideProject(prop.getValueList(), cms.getRequestContext().getSiteRoot() + cms.getRequestContext().getUri())) { mapped.add(res);
boolean grey = false; if (isProjectAware()) { grey = !CmsProject.isInsideProject(projectResources, resource);
boolean grey = false; if (isProjectAware()) { grey = !CmsProject.isInsideProject(projectResources, resource);
if (CmsProject.isInsideProject( prop.getValueList(), cms.getRequestContext().getSiteRoot() + cms.getRequestContext().getUri())) {
while (itProjects.hasNext()) { CmsProject project = itProjects.next(); if (CmsProject.isInsideProject(m_driverManager.readProjectResources(dbc, project), resource)) { canIgnorePublishPermission = true; break;
while (itProjects.hasNext()) { CmsProject project = (CmsProject)itProjects.next(); if (CmsProject.isInsideProject(m_driverManager.readProjectResources(dbc, project), resource)) { canIgnorePublishPermission = true; break;