Author: sergiykarpenko
Date: 2010-11-30 04:44:44 -0500 (Tue, 30 Nov 2010)
New Revision: 3578
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java
Log:
EXOJCR-1083: NewGroupListener.preSave() and preDelete() now uses groupId from incoming
Croup object instead generating it using parentId
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java 2010-11-30
09:41:20 UTC (rev 3577)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java 2010-11-30
09:44:44 UTC (rev 3578)
@@ -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