Fixed centroid visibility evaluation
This commit is contained in:
parent
5442e727df
commit
0a653f2eda
|
@ -210,14 +210,14 @@ public class ConcessioniLifeCycleManager extends Default3PhaseManager implements
|
||||||
if(!indexingProject.getRelationshipsByName(FOLLOWS).isEmpty())
|
if(!indexingProject.getRelationshipsByName(FOLLOWS).isEmpty())
|
||||||
scanRelation(projects,access.getRelations(indexingProject.getProfileID(), indexingProject.getId(), FOLLOWS,true).get(0),false);
|
scanRelation(projects,access.getRelations(indexingProject.getProfileID(), indexingProject.getId(), FOLLOWS,true).get(0),false);
|
||||||
|
|
||||||
log.debug("Produced full chain from {}, evaluating last available for PHASE {} ",indexingProject.getId(),
|
log.debug("Produced full chain [size : {}] from {}, evaluating last available for PHASE {} ",projects.size(),indexingProject.getId(),
|
||||||
indexingProject.getLifecycleInformation().getPhase());
|
indexingProject.getLifecycleInformation().getPhase());
|
||||||
|
|
||||||
List<String> toDisplayId = new ArrayList<>();
|
List<String> toDisplayId = new ArrayList<>();
|
||||||
List<String> toHideIds = new ArrayList<>();
|
List<String> toHideIds = new ArrayList<>();
|
||||||
|
|
||||||
log.trace("Checking from LAST.. ");
|
log.trace("Checking from LAST.. ");
|
||||||
// recurse from last
|
// Projects is time -ordered so we scan from last
|
||||||
for(int i = projects.size()-1;i>=0;i--) {
|
for(int i = projects.size()-1;i>=0;i--) {
|
||||||
Project p = projects.get(i);
|
Project p = projects.get(i);
|
||||||
log.debug("Currently checking {} : {}",p.getId(),p.getTheDocument().get("nome"));
|
log.debug("Currently checking {} : {}",p.getId(),p.getTheDocument().get("nome"));
|
||||||
|
@ -225,11 +225,15 @@ public class ConcessioniLifeCycleManager extends Default3PhaseManager implements
|
||||||
toHideIds.add(p.getId());
|
toHideIds.add(p.getId());
|
||||||
else {
|
else {
|
||||||
//Still need to find candidate for displaying feature
|
//Still need to find candidate for displaying feature
|
||||||
// Check PHASE
|
|
||||||
switch(indexingProject.getLifecycleInformation().getPhase()){
|
//Our currently indexing project is always a good candidate
|
||||||
|
if(p.getId().equals(indexingProject.getId()))
|
||||||
|
toDisplayId.add(p.getId());
|
||||||
|
//We check PHASE in order to skip projects not yet in the PHASE we are indexing
|
||||||
|
else switch(indexingProject.getLifecycleInformation().getPhase()){
|
||||||
case Phases.PENDING_APPROVAL:{
|
case Phases.PENDING_APPROVAL:{
|
||||||
if (p.getLifecycleInformation().getPhase().equals(Phases.PENDING_APPROVAL)||
|
if ((p.getLifecycleInformation().getPhase().equals(Phases.PENDING_APPROVAL)||
|
||||||
p.getLifecycleInformation().getPhase().equals(Phases.PUBLISHED))
|
p.getLifecycleInformation().getPhase().equals(Phases.PUBLISHED)))
|
||||||
toDisplayId.add(p.getId());
|
toDisplayId.add(p.getId());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -239,7 +243,8 @@ public class ConcessioniLifeCycleManager extends Default3PhaseManager implements
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(toDisplayId != null)
|
|
||||||
|
if(!toDisplayId.isEmpty())
|
||||||
log.debug("Found last concessioni candidate for displaying. ID {}, PHASE {} ",toDisplayId,p.getLifecycleInformation().getPhase());
|
log.debug("Found last concessioni candidate for displaying. ID {}, PHASE {} ",toDisplayId,p.getLifecycleInformation().getPhase());
|
||||||
else toHideIds.add(p.getId()); // Still not found
|
else toHideIds.add(p.getId()); // Still not found
|
||||||
}
|
}
|
||||||
|
@ -247,6 +252,9 @@ public class ConcessioniLifeCycleManager extends Default3PhaseManager implements
|
||||||
|
|
||||||
toReturn.put("_toHideIds",toHideIds);
|
toReturn.put("_toHideIds",toHideIds);
|
||||||
toReturn.put("_toDisplayIds",toDisplayId);
|
toReturn.put("_toDisplayIds",toDisplayId);
|
||||||
|
|
||||||
|
|
||||||
|
log.info("Indexing request for Concessione [ID {}] with to HIDE {} and toDisplay {} ",indexingProject.getId(),toHideIds,toDisplayId);
|
||||||
return toReturn;
|
return toReturn;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Unable to evaluate to Hide and Display Ids ",e);
|
log.error("Unable to evaluate to Hide and Display Ids ",e);
|
||||||
|
|
Loading…
Reference in New Issue