Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilhemSempere committed Sep 3, 2024
1 parent 2dec09b commit 8353d85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>fr.cirad</groupId>
<artifactId>role_manager</artifactId>
<version>1.3.7-RELEASE</version>
<version>1.3.8-RELEASE</version>
</dependency>

<dependency>
Expand Down
28 changes: 13 additions & 15 deletions src/main/java/fr/cirad/tools/GigwaModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public class GigwaModuleManager implements IModuleManager {
@Autowired private ServletContext servletContext;
@Autowired private ReloadableInMemoryDaoImpl userDao;
@Autowired private TokenManager tokenManager;
// @Autowired private DumpManager dumpManager;

@Override
public String getModuleHost(String sModule) {
Expand All @@ -126,22 +125,21 @@ public Map<String, Map<Comparable, String[]>> getEntitiesByModule(String entityT
if (fIncludeEntityDescriptions)
q.fields().include(GenotypingProject.FIELDNAME_DESCRIPTION);

for (String sModule : modules != null ? modules : MongoTemplateManager.getAvailableModules())
if (fTrueIfPublicFalseIfPrivateNullIfAny == null || (MongoTemplateManager.isModulePublic(sModule) == fTrueIfPublicFalseIfPrivateNullIfAny)) {
Map<Comparable, String[]> moduleEntities = entitiesByModule.get(sModule);
if (moduleEntities == null) {
moduleEntities = new LinkedHashMap<>();
entitiesByModule.put(sModule, moduleEntities);
}
for (String sModule : modules != null ? modules : MongoTemplateManager.getAvailableModules()) {
Map<Comparable, String[]> moduleEntities = entitiesByModule.get(sModule);
if (moduleEntities == null) {
moduleEntities = new LinkedHashMap<>();
entitiesByModule.put(sModule, moduleEntities);
}

for (GenotypingProject project : MongoTemplateManager.get(sModule).find(q, GenotypingProject.class)) {
String[] projectInfo = new String[fIncludeEntityDescriptions ? 2 : 1];
projectInfo[0] = project.getName();
if (fIncludeEntityDescriptions)
projectInfo[1] = project.getDescription();
moduleEntities.put(project.getId(), projectInfo);
}
for (GenotypingProject project : MongoTemplateManager.get(sModule).find(q, GenotypingProject.class)) {
String[] projectInfo = new String[fIncludeEntityDescriptions ? 2 : 1];
projectInfo[0] = project.getName();
if (fIncludeEntityDescriptions)
projectInfo[1] = project.getDescription();
moduleEntities.put(project.getId(), projectInfo);
}
}
}
else
throw new Exception("Not managing entities of type " + entityType);
Expand Down

0 comments on commit 8353d85

Please sign in to comment.