-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor refactoring - Design level refactors (#2781)
* Minor refactoring - Replace conditional with polymorphism. * Minor refactoring - Move Field - worked on comment - // These 2 should be (public) constants on their respective service classes, not here * Minor refactoring - Rename Field - making the code more readable * Minor refactoring - Rename Field - making the code more readable * Minor refactoring - Move method - the method getUserLayoutTuple seems more relevant to IUserLayoutStore. Hence moving it * Minor refactoring - Extract class PortalaConstants . Identified a cohesive set of variables/constants and grouped them into their own class. * formatting * Refactoring - Extract class - Extracted event coordination helper methods from the PortletEventCoordinatationService into a new class named PortletEventCoordinationHelper. * Refactoring - Extract class - Extracted event coordination helper methods from the PortletEventCoordinatationService into a new class named PortletEventCoordinationHelper. --------- Co-authored-by: himanshi <[email protected]>
- Loading branch information
1 parent
6fad6aa
commit 4364fd1
Showing
15 changed files
with
447 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...al-groups-pags/src/main/java/org/apereo/portal/groups/pags/dao/jpa/LocalGroupService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.apereo.portal.groups.pags.dao.jpa; | ||
|
||
import org.apereo.portal.groups.IEntityGroup; | ||
import org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinition; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class LocalGroupService { | ||
public static final String SERVICE_NAME_LOCAL = "local"; | ||
|
||
public void addMember(IEntityGroup parent, IPersonAttributesGroupDefinition result) { | ||
IEntityGroup member = | ||
org.apereo.portal.services.GroupService.findGroup( | ||
result.getCompositeEntityIdentifierForGroup().getKey()); | ||
if (member == null) { | ||
String msg = | ||
"The specified group was created, but is not present in the store: " | ||
+ result.getName(); | ||
throw new RuntimeException(msg); | ||
} | ||
parent.addChild(member); | ||
parent.updateMembers(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...tal-groups-pags/src/main/java/org/apereo/portal/groups/pags/dao/jpa/PagsGroupService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.apereo.portal.groups.pags.dao.jpa; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
import org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinition; | ||
import org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinitionDao; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class PagsGroupService { | ||
public static final String SERVICE_NAME_PAGS = "pags"; | ||
@Autowired private IPersonAttributesGroupDefinitionDao pagsGroupDefDao; | ||
private final Logger logger = LoggerFactory.getLogger(getClass()); | ||
|
||
public void addMember( | ||
IPersonAttributesGroupDefinition parentDef, IPersonAttributesGroupDefinition result) { | ||
|
||
Set<IPersonAttributesGroupDefinition> members = new HashSet<>(parentDef.getMembers()); | ||
members.add(result); | ||
parentDef.setMembers(members); | ||
pagsGroupDefDao.updatePersonAttributesGroupDefinition(parentDef); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.