/** * Sets a new parent group for an already existing group.<p> * * @param dbc the current database context * @param groupName the name of the group that should be written * @param parentGroupName the name of the parent group to set, * or <code>null</code> if the parent * group should be deleted. * * @throws CmsException if operation was not successful * @throws CmsDataAccessException if the group with <code>groupName</code> could not be read from VFS */ public void setParentGroup(CmsDbContext dbc, String groupName, String parentGroupName) throws CmsException, CmsDataAccessException { CmsGroup group = readGroup(dbc, groupName); CmsUUID parentGroupId = CmsUUID.getNullUUID(); // if the group exists, use its id, else set to unknown. if (parentGroupName != null) { parentGroupId = readGroup(dbc, parentGroupName).getId(); } group.setParentId(parentGroupId); // write the changes to the cms writeGroup(dbc, group); }
/** * Sets a new parent group for an already existing group.<p> * * @param dbc the current database context * @param groupName the name of the group that should be written * @param parentGroupName the name of the parent group to set, * or <code>null</code> if the parent * group should be deleted. * * @throws CmsException if operation was not successful * @throws CmsDataAccessException if the group with <code>groupName</code> could not be read from VFS */ public void setParentGroup(CmsDbContext dbc, String groupName, String parentGroupName) throws CmsException, CmsDataAccessException { CmsGroup group = readGroup(dbc, groupName); CmsUUID parentGroupId = CmsUUID.getNullUUID(); // if the group exists, use its id, else set to unknown. if (parentGroupName != null) { parentGroupId = readGroup(dbc, parentGroupName).getId(); } group.setParentId(parentGroupId); // write the changes to the cms writeGroup(dbc, group); }
} else { if (getParentGroup() != null) { m_group.setParentId(getCms().readGroup(getParentGroup()).getId()); } else { m_group.setParentId(CmsUUID.getNullUUID());
while (itChildren.hasNext()) { CmsGroup child = (CmsGroup)itChildren.next(); child.setParentId(parentId); writeGroup(dbc, child); while (itChildren.hasNext()) { CmsGroup child = (CmsGroup)itChildren.next(); child.setParentId(replacementId); writeGroup(dbc, child);
while (itChildren.hasNext()) { CmsGroup child = itChildren.next(); child.setParentId(parentId); writeGroup(dbc, child); while (itChildren.hasNext()) { CmsGroup child = itChildren.next(); child.setParentId(replacementId); writeGroup(dbc, child);