/** * Returns the simple name of this organizational unit. * * @return the simple name of this organizational unit. */ public String getSimpleName() { return getSimpleName(m_name); }
/** * Returns the simple name of this organizational unit. * * @return the simple name of this organizational unit. */ public String getSimpleName() { return CmsOrganizationalUnit.getSimpleName(m_name); }
/** * Returns the simple name of this organizational unit. * * @return the simple name of this organizational unit. */ public String getSimpleName() { return getSimpleName(m_name); }
/** * Returns the simple name of this organizational unit. * * @return the simple name of this organizational unit. */ public String getSimpleName() { return CmsOrganizationalUnit.getSimpleName(m_name); }
/** * Returns the simple name of this organizational unit. * * @return the simple name of this organizational unit. */ public String getSimpleName() { return CmsOrganizationalUnit.getSimpleName(m_name); }
/** * Returns the simple name of this organizational unit. * * @return the simple name of this organizational unit. */ public String getSimpleName() { return CmsOrganizationalUnit.getSimpleName(m_name); }
public String translateGroupName(String group, boolean keepOu) { return keepOu ? group : CmsOrganizationalUnit.getSimpleName(group); } };
/** * @see org.opencms.security.I_CmsPrincipal#setName(java.lang.String) */ public void setName(String name) { checkName(CmsOrganizationalUnit.getSimpleName(name)); m_name = name; } }
/** * @see org.opencms.security.I_CmsPrincipal#setName(java.lang.String) */ public void setName(String name) { checkName(CmsOrganizationalUnit.getSimpleName(name)); m_name = name; } }
/** * Returns the simple name if the ou is the same as the current user's ou.<p> * * @param name the fully qualified name to check * * @return the simple name if the ou is the same as the current user's ou */ private String getCurrentOuRelativeName(String name) { if (m_request == null) { return CmsOrganizationalUnit.SEPARATOR + name; } String ou = CmsOrganizationalUnit.getParentFqn(name); if (ou.equals(m_request.getCurrentUser().getOuFqn())) { return CmsOrganizationalUnit.getSimpleName(name); } return CmsOrganizationalUnit.SEPARATOR + name; }
/** * Returns the simple name if the ou is the same as the current user's ou.<p> * * @param name the fully qualified name to check * * @return the simple name if the ou is the same as the current user's ou */ private String getCurrentOuRelativeName(String name) { if (m_request == null) { return CmsOrganizationalUnit.SEPARATOR + name; } String ou = CmsOrganizationalUnit.getParentFqn(name); if (ou.equals(m_request.currentUser().getOuFqn())) { return CmsOrganizationalUnit.getSimpleName(name); } return CmsOrganizationalUnit.SEPARATOR + name; }
/** * Returns the simple name if the ou is the same as the current user's ou.<p> * * @param cms the CMS context * @param name the fully qualified name to check * * @return the simple name if the ou is the same as the current user's ou */ protected static String getOuAwareName(CmsObject cms, String name) { String ou = CmsOrganizationalUnit.getParentFqn(name); if (ou.equals(cms.getRequestContext().getCurrentUser().getOuFqn())) { return CmsOrganizationalUnit.getSimpleName(name); } return CmsOrganizationalUnit.SEPARATOR + name; }
/** * Returns the simple name if the ou is the same as the current user's ou.<p> * * @param cms the CMS context * @param name the fully qualified name to check * * @return the simple name if the ou is the same as the current user's ou */ protected static String getOuAwareName(CmsObject cms, String name) { String ou = CmsOrganizationalUnit.getParentFqn(name); if (ou.equals(cms.getRequestContext().getCurrentUser().getOuFqn())) { return CmsOrganizationalUnit.getSimpleName(name); } return CmsOrganizationalUnit.SEPARATOR + name; }
/** * Returns the simple name if the ou is the same as the current user's ou.<p> * * @param cms the CMS context * @param name the fully qualified name to check * * @return the simple name if the ou is the same as the current user's ou */ public static String getOuAwareName(CmsObject cms, String name) { String ou = CmsOrganizationalUnit.getParentFqn(name); if (ou.equals(cms.getRequestContext().getCurrentUser().getOuFqn())) { return CmsOrganizationalUnit.getSimpleName(name); } return CmsOrganizationalUnit.SEPARATOR + name; }
/** * @see org.opencms.db.I_CmsUserDriver#deleteGroup(org.opencms.db.CmsDbContext, java.lang.String) */ public void deleteGroup(CmsDbContext dbc, String groupFqn) throws CmsDataAccessException { try { Query q = m_sqlManager.createQuery(dbc, C_GROUPS_DELETE_GROUP_2); q.setParameter(1, CmsOrganizationalUnit.getSimpleName(groupFqn)); q.setParameter(2, CmsOrganizationalUnit.SEPARATOR + CmsOrganizationalUnit.getParentFqn(groupFqn)); List<CmsDAOGroups> res = q.getResultList(); for (CmsDAOGroups g : res) { m_sqlManager.remove(dbc, g); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } }
/** * @see org.opencms.db.I_CmsUserDriver#existsGroup(org.opencms.db.CmsDbContext, java.lang.String) */ public boolean existsGroup(CmsDbContext dbc, String groupFqn) throws CmsDataAccessException { boolean result = false; try { Query q = m_sqlManager.createQuery(dbc, C_GROUPS_CHECK_BY_NAME_2); q.setParameter(1, CmsOrganizationalUnit.getSimpleName(groupFqn)); q.setParameter(2, CmsOrganizationalUnit.SEPARATOR + CmsOrganizationalUnit.getParentFqn(groupFqn)); int count = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); if (count > 0) { result = true; } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } return result; }
/** * @see org.opencms.db.I_CmsUserDriver#existsUser(org.opencms.db.CmsDbContext, java.lang.String) */ public boolean existsUser(CmsDbContext dbc, String userFqn) throws CmsDataAccessException { boolean result = false; try { Query q = m_sqlManager.createQuery(dbc, C_USERS_CHECK_BY_NAME_2); q.setParameter(1, CmsOrganizationalUnit.getSimpleName(userFqn)); q.setParameter(2, CmsOrganizationalUnit.SEPARATOR + CmsOrganizationalUnit.getParentFqn(userFqn)); int count = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); if (count > 0) { result = true; } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } return result; }
/** * @see org.opencms.db.I_CmsUserDriver#deleteGroup(org.opencms.db.CmsDbContext, java.lang.String) */ public void deleteGroup(CmsDbContext dbc, String groupFqn) throws CmsDataAccessException { Connection conn = null; PreparedStatement stmt = null; try { conn = getSqlManager().getConnection(dbc); stmt = m_sqlManager.getPreparedStatement(conn, "C_GROUPS_DELETE_GROUP_2"); stmt.setString(1, CmsOrganizationalUnit.getSimpleName(groupFqn)); stmt.setString(2, CmsOrganizationalUnit.SEPARATOR + CmsOrganizationalUnit.getParentFqn(groupFqn)); stmt.executeUpdate(); } catch (SQLException e) { throw new CmsDbSqlException( Messages.get().container(Messages.ERR_GENERIC_SQL_1, CmsDbSqlException.getErrorQuery(stmt)), e); } finally { m_sqlManager.closeAll(dbc, conn, stmt, null); } }
/** * @see org.opencms.db.I_CmsUserDriver#deleteGroup(org.opencms.db.CmsDbContext, java.lang.String) */ public void deleteGroup(CmsDbContext dbc, String groupFqn) throws CmsDataAccessException { Connection conn = null; PreparedStatement stmt = null; try { conn = getSqlManager().getConnection(dbc); stmt = m_sqlManager.getPreparedStatement(conn, "C_GROUPS_DELETE_GROUP_2"); stmt.setString(1, CmsOrganizationalUnit.getSimpleName(groupFqn)); stmt.setString(2, CmsOrganizationalUnit.SEPARATOR + CmsOrganizationalUnit.getParentFqn(groupFqn)); stmt.executeUpdate(); } catch (SQLException e) { throw new CmsDbSqlException(Messages.get().container( Messages.ERR_GENERIC_SQL_1, CmsDbSqlException.getErrorQuery(stmt)), e); } finally { m_sqlManager.closeAll(dbc, conn, stmt, null); } }
/** * @see org.opencms.db.I_CmsProjectDriver#readProject(org.opencms.db.CmsDbContext, java.lang.String) */ public CmsProject readProject(CmsDbContext dbc, String projectFqn) throws CmsDataAccessException { CmsProject project = null; try { Query q = m_sqlManager.createQuery(dbc, C_PROJECTS_READ_BYNAME_2); q.setParameter(1, CmsOrganizationalUnit.getSimpleName(projectFqn)); q.setParameter(2, CmsOrganizationalUnit.SEPARATOR + CmsOrganizationalUnit.getParentFqn(projectFqn)); try { CmsDAOProjects p = (CmsDAOProjects)q.getSingleResult(); project = internalCreateProject(p); } catch (NoResultException e) { throw new CmsDbEntryNotFoundException( Messages.get().container(Messages.ERR_NO_PROJECT_WITH_NAME_1, projectFqn)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } return project; }