Reads all property definitions for the given mapping type.<p>

@param dbc the current database context

@return a list with the <code>{@link CmsPropertyDefinition}</code> objects (may be empty)

@throws CmsException if something goes wrong
488815
public List<CmsPropertyDefinition> readAllPropertyDefinitions(CmsDbContext dbc) throws CmsException {

        List<CmsPropertyDefinition> result = getVfsDriver(dbc).readPropertyDefinitions(
            dbc,
            dbc.currentProject().getUuid());
        Collections.sort(result);
        return result;
    }
1179980
public Map<String, CmsDefaultSet<String>> getAllowedContextMap(CmsObject cms) {

        Map<String, CmsDefaultSet<String>> result = new HashMap<String, CmsDefaultSet<String>>();
        for (I_CmsResourceType resType : getResourceTypes()) {
            if (resType instanceof CmsResourceTypeXmlContent) {
                String schema = null;
                try {
                    schema = ((CmsResourceTypeXmlContent)resType).getSchema();
                    if (schema != null) {
                        CmsXmlContentDefinition contentDefinition = CmsXmlContentDefinition.unmarshal(cms, schema);

                        CmsDefaultSet<String> allowedContexts = contentDefinition.getContentHandler().getAllowedTemplates();
                        result.put(resType.getTypeName(), allowedContexts);
                    } else {
                        LOG.info(
                            "No schema for XML type " + resType.getTypeName() + " / " + resType.getClass().getName());
                    }
                } catch (Exception e) {
                    LOG.error(
                        "Error in getAllowedContextMap, schema="
                            + schema
                            + ", type="
                            + resType.getTypeName()
                            + ", "
                            + e.getLocalizedMessage(),
                        e);
                }
            }
        }
        return result;
    }
1010026
private CmsUUID getProjectIdForContext(CmsDbContext dbc) {

        CmsUUID projectId = dbc.getProjectId();
        if (projectId.isNullUUID()) {
            projectId = dbc.currentProject().getUuid();
        }
        return projectId;
    }
809556
private List<String> getIndexes(CmsSetupDb dbCon, String tablename) throws SQLException {

        List<String> indexes = new ArrayList<String>();
        String tableIndex = readQuery(QUERY_SHOW_INDEX);
        Map<String, String> replacer = new HashMap<String, String>();
        replacer.put(REPLACEMENT_TABLENAME, tablename);
        CmsSetupDBWrapper db = null;
        try {
            db = dbCon.executeSqlStatement(tableIndex, replacer);
            while (db.getResultSet().next()) {
                String index = db.getResultSet().getString(FIELD_INDEX);

                if (!indexes.contains(index)) {
                    indexes.add(index);
                }

            }
        } finally {
            if (db != null) {
                db.close();
            }
        }
        return indexes;
    }
669989
public List<CmsUrlNameMappingEntry> readUrlNameMappings(CmsDbContext dbc, CmsUrlNameMappingFilter filter)
    throws CmsDataAccessException {

        List<CmsUrlNameMappingEntry> entries = getVfsDriver(dbc).readUrlNameMappingEntries(
            dbc,
            dbc.currentProject().isOnlineProject(),
            filter);
        return entries;
    }
478370
public CmsUser readUser(CmsDbContext dbc, String username) throws CmsDataAccessException {

        CmsUser user = m_monitor.getCachedUser(username);
        if (user == null) {
            user = getUserDriver(dbc).readUser(dbc, username);
            m_monitor.cacheUser(user);
        }
        // important: do not return the cached user object, but a clone to avoid unwanted changes on cached objects
        return user.clone();
    }
660246
protected List<CmsProperty> getOpenCmsProperties(Map<String, PropertyData<?>> properties) {

        List<CmsProperty> cmsProperties = new ArrayList<CmsProperty>();
        for (Map.Entry<String, PropertyData<?>> entry : properties.entrySet()) {
            String propId = entry.getKey();
            if (propId.startsWith(CmsCmisTypeManager.PROPERTY_PREFIX)) {
                String propName = propId.substring(CmsCmisTypeManager.PROPERTY_PREFIX.length());
                String value = (String)entry.getValue().getFirstValue();
                if (value == null) {
                    value = "";
                }
                cmsProperties.add(new CmsProperty(propName, value, null));
            }
        }
        return cmsProperties;
    }
113392
public List<CmsResource> getUsersPubList(CmsRequestContext context) throws CmsException {

        List<CmsResource> result = null;
        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        try {
            result = m_driverManager.getUsersPubList(dbc, context.getCurrentUser().getId());
        } catch (Exception e) {
            dbc.report(
                null,
                Messages.get().container(Messages.ERR_READ_USER_PUBLIST_1, context.getCurrentUser().getName()),
                e);

        } finally {
            dbc.clear();
        }
        return result;
    }
18311
public CmsGroup readGroup(CmsDbContext dbc, String groupname) throws CmsDataAccessException {

        CmsGroup group = null;
        // try to read group from cache
        group = m_monitor.getCachedGroup(groupname);
        if (group == null) {
            group = getUserDriver(dbc).readGroup(dbc, groupname);
            m_monitor.cacheGroup(group);
        }
        return group;
    }
1321690
protected void readFromDB4Properties()
        throws CacheReloadException
    {
        Connection con = null;
        try {
            con = Context.getConnection();
            final PreparedStatement stmt = con.prepareStatement(AbstractAdminObject.SELECT);
            stmt.setObject(1, getId());
            final ResultSet rs = stmt.executeQuery();
            AbstractAdminObject.LOG.debug("Reading Properties for '{}'", getName());
            while (rs.next()) {
                final String nameStr = rs.getString(1).trim();
                final String value = rs.getString(2).trim();
                setProperty(nameStr, value);
                AbstractAdminObject.LOG.debug("    Name: '{}' - Value: '{}'", new Object[] { nameStr, value });
            }
            rs.close();
            stmt.close();
            con.commit();
            con.close();
        } catch (final SQLException e) {
            throw new CacheReloadException("could not read properties for " + "'" + getName() + "'", e);
        } catch (final EFapsException e) {
            throw new CacheReloadException("could not read properties for " + "'" + getName() + "'", e);
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                throw new CacheReloadException("Cannot read a type for an attribute.", e);
            }
        }
    }
985421
public CmsResource readParentFolder(CmsDbContext dbc, CmsUUID structureId) throws CmsDataAccessException {

        return getVfsDriver(dbc).readParentFolder(dbc, dbc.currentProject().getUuid(), structureId);
    }
1353639
public void removeDeletedResource(CmsDbContext dbc, String resourceName) throws CmsException {

        try {
            m_driverManager.getVfsDriver(dbc).readResource(dbc, dbc.currentProject().getUuid(), resourceName, false);
            throw new CmsLockException(
                Messages.get().container(
                    Messages.ERR_REMOVING_UNDELETED_RESOURCE_1,
                    dbc.getRequestContext().removeSiteRoot(resourceName)));
        } catch (CmsVfsResourceNotFoundException e) {
            // ok, ignore
        }
        unlockResource(resourceName, true);
        unlockResource(resourceName, false);
    }
416410
public int incrementCounter(CmsDbContext dbc, String name) throws CmsException {

        return getVfsDriver(dbc).incrementCounter(dbc, name);
    }
638975
public CmsUser readUser(CmsRequestContext context, CmsUUID id) throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        CmsUser result = null;
        try {
            result = m_driverManager.readUser(dbc, id);
        } catch (Exception e) {
            dbc.report(null, Messages.get().container(Messages.ERR_READ_USER_FOR_ID_1, id.toString()), e);
        } finally {
            dbc.clear();
        }
        return result;
    }
1289997
public CmsProject readProject(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException {

        CmsProject project = null;
        project = m_monitor.getCachedProject(id.toString());
        if (project == null) {
            project = getProjectDriver(dbc).readProject(dbc, id);
            m_monitor.cacheProject(project);
        }
        return project;
    }
217812
public List<CmsAccessControlEntry> getAllAccessControlEntries(CmsDbContext dbc) throws CmsException {

        I_CmsUserDriver userDriver = getUserDriver(dbc);
        List<CmsAccessControlEntry> ace = userDriver.readAccessControlEntries(
            dbc,
            dbc.currentProject(),
            CmsAccessControlEntry.PRINCIPAL_READALL_ID,
            false);
        return ace;
    }
642503
public CmsGroup readGroup(CmsRequestContext context, CmsUUID groupId) throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        CmsGroup result = null;
        try {
            result = m_driverManager.readGroup(dbc, groupId);
        } catch (Exception e) {
            dbc.report(null, Messages.get().container(Messages.ERR_READ_GROUP_FOR_ID_1, groupId.toString()), e);
        } finally {
            dbc.clear();
        }
        return result;
    }