Author: sergiykarpenko
Date: 2010-11-30 03:46:00 -0500 (Tue, 30 Nov 2010)
New Revision: 3576
Modified:
jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java
Log:
JCR-1527: NewGroupListener.preSave() and preDelete() now uses groupId from incoming Croup
object instead generating it using parentId
Modified:
jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java 2010-11-29
07:27:57 UTC (rev 3575)
+++
jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java 2010-11-30
08:46:00 UTC (rev 3576)
@@ -63,14 +63,24 @@
groupsPath_ = nodeHierarchyCreatorService.getJcrPath(GROUPS_PATH);
}
+ /**
+ * {@inheritDoc}
+ */
public void preSave(Group group, boolean isNew) throws Exception
{
String groupId = null;
- String parentId = group.getParentId();
- if (parentId == null || parentId.length() == 0)
- groupId = "/" + group.getGroupName();
+ if (group.getId() != null)
+ {
+ groupId = group.getId();
+ }
else
- groupId = parentId + "/" + group.getGroupName();
+ {
+ String parentId = group.getParentId();
+ if (parentId == null || parentId.length() == 0)
+ groupId = "/" + group.getGroupName();
+ else
+ groupId = parentId + "/" + group.getGroupName();
+ }
List<RepositoryEntry> repositories =
jcrService_.getConfig().getRepositoryConfigurations();
if (isNew)
{
@@ -81,14 +91,24 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
public void preDelete(Group group) throws Exception
{
String groupId = null;
- String parentId = group.getParentId();
- if (parentId == null || parentId.length() == 0)
- groupId = "/" + group.getGroupName();
+ if (group.getId() != null)
+ {
+ groupId = group.getId();
+ }
else
- groupId = parentId + "/" + group.getGroupName();
+ {
+ String parentId = group.getParentId();
+ if (parentId == null || parentId.length() == 0)
+ groupId = "/" + group.getGroupName();
+ else
+ groupId = parentId + "/" + group.getGroupName();
+ }
List<RepositoryEntry> repositories =
jcrService_.getConfig().getRepositoryConfigurations();
for (RepositoryEntry repo : repositories)
{
Show replies by date