/** * Returns the list of root paths associated to the organizational unit represented by the given resource.<p> * * @param dbc the current db context * @param ouResource the resource that represents the organizational unit to get the resources for * * @return the list of associated resource names * * @throws CmsException if something goes wrong */ protected List internalResourcesForOrgUnit(CmsDbContext dbc, CmsResource ouResource) throws CmsException { List relations = m_driverManager.getRelationsForResource(dbc, ouResource, CmsRelationFilter.TARGETS); List paths = new ArrayList(); Iterator it = relations.iterator(); while (it.hasNext()) { CmsRelation relation = (CmsRelation)it.next(); paths.add(relation.getTargetPath()); } return paths; }
/** * Returns the list of root paths associated to the organizational unit represented by the given resource.<p> * * @param dbc the current db context * @param ouResource the resource that represents the organizational unit to get the resources for * * @return the list of associated resource names * * @throws CmsException if something goes wrong */ protected List<String> internalResourcesForOrgUnit(CmsDbContext dbc, CmsResource ouResource) throws CmsException { List<CmsRelation> relations = m_driverManager.getRelationsForResource( dbc, ouResource, CmsRelationFilter.TARGETS); List<String> paths = new ArrayList<String>(); Iterator<CmsRelation> it = relations.iterator(); while (it.hasNext()) { CmsRelation relation = it.next(); paths.add(relation.getTargetPath()); } return paths; }
/** * Returns the list of root paths associated to the organizational unit represented by the given resource.<p> * * @param dbc the current db context * @param ouResource the resource that represents the organizational unit to get the resources for * * @return the list of associated resource names * * @throws CmsException if something goes wrong */ protected List<String> internalResourcesForOrgUnit(CmsDbContext dbc, CmsResource ouResource) throws CmsException { List<CmsRelation> relations = m_driverManager.getRelationsForResource( dbc, ouResource, CmsRelationFilter.TARGETS); List<String> paths = new ArrayList<String>(); Iterator<CmsRelation> it = relations.iterator(); while (it.hasNext()) { CmsRelation relation = it.next(); paths.add(relation.getTargetPath()); } return paths; }
Iterator itRelations = getRelationsForResource( dbc, source,
Iterator<CmsRelation> itRelations = getRelationsForResource( dbc, source,
Iterator itRelations = getRelationsForResource(dbc, checkResource, filter).iterator(); while (itRelations.hasNext()) { CmsRelation relation = (CmsRelation)itRelations.next();
Iterator<CmsRelation> itRelations = getRelationsForResource(dbc, checkResource, filter).iterator(); while (itRelations.hasNext()) { CmsRelation relation = itRelations.next();
if (!resource.getState().isDeleted()) { outgoingRelationsOffline = m_driverManager.getRelationsForResource( dbc, resource, dbc.getRequestContext().setCurrentProject(project); try { incomingRelationsOnline = m_driverManager.getRelationsForResource( dbc, resource,
/** * Returns all relations for the given resource matching the given filter.<p> * * @param context the current user context * @param resource the resource to retrieve the relations for * @param filter the filter to match the relation * * @return all {@link org.opencms.relations.CmsRelation} objects for the given resource matching the given filter * * @throws CmsException if something goes wrong * * @see CmsObject#getRelationsForResource(String, CmsRelationFilter) */ public List getRelationsForResource(CmsRequestContext context, CmsResource resource, CmsRelationFilter filter) throws CmsException { List result = null; CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { // check the access permissions checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_VIEW, false, CmsResourceFilter.ALL); result = m_driverManager.getRelationsForResource(dbc, resource, filter); } catch (Exception e) { dbc.report(null, Messages.get().container( Messages.ERR_READ_RELATIONS_1, context.removeSiteRoot(resource.getRootPath())), e); } finally { dbc.clear(); } return result; }
checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_VIEW, false, CmsResourceFilter.ALL); result = m_driverManager.getRelationsForResource(dbc, resource, filter); } catch (Exception e) { dbc.report(
if (!resource.getState().isDeleted()) { relations = m_driverManager.getRelationsForResource(dbc, resource, CmsRelationFilter.TARGETS); } else { dbc.getRequestContext().setCurrentProject(project); try { relations = m_driverManager.getRelationsForResource(dbc, resource, CmsRelationFilter.SOURCES); } finally { dbc.getRequestContext().setCurrentProject(currentProject);