/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsDbConsistencyException(container, cause); } }
/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsDbConsistencyException(container, cause); } }
throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3, resource.getRootPath(),
break; default: throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3, break; default: throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3,
/** * Moves an user to the given organizational unit.<p> * * @param dbc the current db context * @param orgUnit the organizational unit to move the user to * @param user the user that is to be moved to the organizational unit * * @throws CmsException if something goes wrong * * @see org.opencms.security.CmsOrgUnitManager#setUsersOrganizationalUnit(CmsObject, String, String) */ public void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user) throws CmsException { if (!getGroupsOfUser(dbc, user.getName(), false).isEmpty()) { throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_ORGUNIT_MOVE_USER_2, orgUnit.getName(), user.getName())); } // move the principal m_userDriver.setUsersOrganizationalUnit(dbc, orgUnit, user); // remove the principal from cache m_monitor.clearUserCache(user); // fire user modified event Map eventData = new HashMap(); eventData.put(I_CmsEventListener.KEY_USER_ID, user.getId().toString()); eventData.put(I_CmsEventListener.KEY_OU_NAME, user.getOuFqn()); eventData.put(I_CmsEventListener.KEY_USER_ACTION, I_CmsEventListener.VALUE_USER_MODIFIED_ACTION_SET_OU); OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_USER_MODIFIED, eventData)); }
break; default: throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3, break; default: throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3,
throw new CmsDbConsistencyException( Messages.get().container(Messages.ERR_NO_PROPERTIES_FOR_PROPERTYDEF_1, metadef.getName()));
throw new CmsDbConsistencyException( Messages.get().container(Messages.ERR_COUNTING_PROPERTIES_1, propertyDefinition.getName()));
break; default: throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3, resource.getRootPath(), break; default: throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3, resource.getRootPath(),
throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_COUNTING_PROPERTIES_1, propertyDefinition.getName()));
throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_NO_PROPERTIES_FOR_PROPERTYDEF_1, metadef.getName()));
throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_TOO_MANY_PROPERTIES_3, key, property.setResourceValue(propertyValue); } else { throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3, resource.getRootPath(),
throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3,
/** * Returns the count of properties for a property definition.<p> * * @param dbc the current database context * @param propertyDefinition the property definition to test * @param projectId the ID of the current project * * @return the amount of properties for a property definition * @throws CmsDataAccessException if something goes wrong */ protected int internalCountProperties(CmsDbContext dbc, CmsPropertyDefinition propertyDefinition, CmsUUID projectId) throws CmsDataAccessException { int count = 0; try { // create statement Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_READALL_COUNT); q.setParameter(1, propertyDefinition.getId().toString()); try { count = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); } catch (NoResultException e) { throw new CmsDbConsistencyException( Messages.get().container(Messages.ERR_COUNTING_PROPERTIES_1, propertyDefinition.getName())); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } return count; }
/** * Returns the amount of properties for a propertydefinition.<p> * * @param dbc the current database context * @param metadef the propertydefinition to test * @param projectId the ID of the current project * * @return the amount of properties for a propertydefinition * @throws CmsDataAccessException if something goes wrong */ protected int internalCountProperties(CmsDbContext dbc, CmsPropertyDefinition metadef, CmsUUID projectId) throws CmsDataAccessException { int returnValue; try { // create statement Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_READALL_COUNT); q.setParameter(1, metadef.getId().toString()); try { returnValue = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); } catch (NoResultException e) { throw new CmsDbConsistencyException( Messages.get().container(Messages.ERR_NO_PROPERTIES_FOR_PROPERTYDEF_1, metadef.getName())); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } return returnValue; }
throw new CmsDbConsistencyException( Messages.get().container(Messages.ERR_ORGUNIT_MOVE_USER_2, orgUnit.getName(), user.getName()));
throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_TOO_MANY_PROPERTIES_3, property.setResourceValue(propertyValue); } else { throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3,
throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_ORGUNIT_DELETE_IN_CONTEXT_1, organizationalUnit.getName())); throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_ORGUNIT_DELETE_CURRENT_USER_1, organizationalUnit.getName())); throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_ORGUNIT_DELETE_SUB_ORGUNITS_1, organizationalUnit.getName())); CmsGroup group = (CmsGroup)itGroups.next(); if (!OpenCms.getDefaultUsers().isDefaultGroup(group.getName())) { throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_ORGUNIT_DELETE_GROUPS_1, organizationalUnit.getName())); throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_ORGUNIT_DELETE_USERS_1, organizationalUnit.getName()));
throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3,
throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_TOO_MANY_PROPERTIES_3, property.setResourceValue(propertyValue); } else { throw new CmsDbConsistencyException( Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3,