starting mapping to catalogue
This commit is contained in:
parent
894748fb53
commit
27126d1c9f
|
@ -23,7 +23,6 @@ import org.gcube.application.geoportal.common.model.document.lifecycle.Lifecycle
|
||||||
import org.gcube.common.authorization.utils.manager.SecretManager;
|
import org.gcube.common.authorization.utils.manager.SecretManager;
|
||||||
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
||||||
import org.gcube.portlets.user.uriresolvermanager.resolvers.query.GeoportalResolverQueryStringBuilder.RESOLVE_AS;
|
import org.gcube.portlets.user.uriresolvermanager.resolvers.query.GeoportalResolverQueryStringBuilder.RESOLVE_AS;
|
||||||
import org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEventType;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@ -169,12 +168,6 @@ public class ManageDoActionNotification {
|
||||||
return filteredList;
|
return filteredList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static CatalogueEventType toCatalogueEventType(String itemPhase, String lastInvokedStep) {
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list user compliant to roles.
|
* Gets the list user compliant to roles.
|
||||||
*
|
*
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
package org.gcube.application.cms.notifications.manage.mapping;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.plugins.implementations.Default3PhaseManager;
|
||||||
|
import org.gcube.application.cms.plugins.implementations.SimpleLifeCycleManager;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
|
import org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEventType;
|
||||||
|
|
||||||
|
public class MappingToCatalogue {
|
||||||
|
|
||||||
|
public static CatalogueEventType toCatalogueEventType(String itemPhase, String lastInvokedStep) {
|
||||||
|
|
||||||
|
// SimpleLifeCycleManager
|
||||||
|
if (itemPhase.equals(SimpleLifeCycleManager.Phases.PUBLISHED)
|
||||||
|
&& lastInvokedStep.equals(SimpleLifeCycleManager.Steps.PUBLISH.getId())) {
|
||||||
|
return CatalogueEventType.ITEM_SUBMITTED;
|
||||||
|
} else if (itemPhase.equals(SimpleLifeCycleManager.Phases.UNPUBLISHED)
|
||||||
|
&& lastInvokedStep.equals(SimpleLifeCycleManager.Steps.UNPUBLISH.getId())) {
|
||||||
|
// TODO
|
||||||
|
// Missing ITEM UNPUBLISHED;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default3PhaseManager
|
||||||
|
if (itemPhase.equals(Default3PhaseManager.Phases.PENDING_APPROVAL)
|
||||||
|
&& lastInvokedStep.equals(Default3PhaseManager.STEPS.SUBMIT.getId())) {
|
||||||
|
return CatalogueEventType.ITEM_SUBMITTED;
|
||||||
|
} else if (itemPhase.equals(Default3PhaseManager.Phases.PUBLISHED)
|
||||||
|
&& lastInvokedStep.equals(Default3PhaseManager.STEPS.APPROVE.getId())) {
|
||||||
|
return CatalogueEventType.ITEM_PUBLISHED;
|
||||||
|
} else if (itemPhase.equals(LifecycleInformation.CommonPhases.DRAFT_PHASE)
|
||||||
|
&& lastInvokedStep.equals(Default3PhaseManager.STEPS.REJECT.getId())) {
|
||||||
|
return CatalogueEventType.ITEM_REJECTED;
|
||||||
|
} else if (itemPhase.equals(LifecycleInformation.CommonPhases.DRAFT_PHASE)
|
||||||
|
&& lastInvokedStep.equals(Default3PhaseManager.STEPS.UNPUBLISH.getId())) {
|
||||||
|
// TODO
|
||||||
|
// Missing ITEM UNPUBLISHED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue