removed vos from frontpage

This commit is contained in:
Lucio Lelii 2022-07-25 11:00:44 +02:00
parent 2fe7d3d4bc
commit 08838cb6d6
4 changed files with 3 additions and 39 deletions

View File

@ -91,37 +91,8 @@ public class FrontPageResource extends ApiResource {
values.put("version", context().configuration().version()); values.put("version", context().configuration().version());
String infrastructure = context().container().configuration().infrastructure(); String infrastructure = context().container().configuration().infrastructure();
StringBuilder voValue = new StringBuilder();
Set<String> vos = new HashSet<String>();
//pre-process
for (String scope : context().container().configuration().authorizationProvider().getContexts()) {
ContextBean bean = new ContextBean(scope);
switch (bean.type()) {
case INFRASTRUCTURE:
infrastructure = bean.name();
break;
case VO:
vos.add(bean.name());
break;
case VRE:
vos.add(bean.enclosingScope().name());
infrastructure=bean.enclosingScope().enclosingScope().name();
}
}
//build vo value
int i = 0;
int max = vos.size()-1;
for (String vo : vos) {
String voPrefix = i == 0 ? "" : (i==max?" and ":", ");
voValue.append(voPrefix+"<em>" + vo + "</em>");
i++;
}
values.put("infra", infrastructure); values.put("infra", infrastructure);
values.put("vos", voValue.toString());
values.put("status", context().lifecycle().state().toString()); values.put("status", context().lifecycle().state().toString());

View File

@ -2,8 +2,6 @@ package org.gcube.smartgears.handlers.application.request;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.xml.bind.annotation.XmlRootElement;
import org.gcube.accounting.datamodel.UsageRecord.OperationResult; import org.gcube.accounting.datamodel.UsageRecord.OperationResult;
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord; import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
import org.gcube.accounting.persistence.AccountingPersistence; import org.gcube.accounting.persistence.AccountingPersistence;
@ -21,7 +19,6 @@ import org.slf4j.LoggerFactory;
import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Metrics;
@XmlRootElement(name = Constants.request_accounting)
public class RequestAccounting extends RequestHandler { public class RequestAccounting extends RequestHandler {
private static Logger log = LoggerFactory.getLogger(RequestAccounting.class); private static Logger log = LoggerFactory.getLogger(RequestAccounting.class);
@ -47,7 +44,6 @@ public class RequestAccounting extends RequestHandler {
if (calledMethod.isEmpty()) if (calledMethod.isEmpty())
calledMethod = "/"; calledMethod = "/";
calledMethod= e.request().getMethod()+" "+calledMethod; calledMethod= e.request().getMethod()+" "+calledMethod;
InnerMethodName.instance.set(calledMethod); InnerMethodName.instance.set(calledMethod);
} }

View File

@ -7,8 +7,6 @@ import static org.gcube.smartgears.handlers.application.request.RequestError.inv
import java.util.Set; import java.util.Set;
import javax.xml.bind.annotation.XmlRootElement;
import org.gcube.common.security.ContextBean; import org.gcube.common.security.ContextBean;
import org.gcube.common.security.ContextBean.Type; import org.gcube.common.security.ContextBean.Type;
import org.gcube.common.security.providers.SecretManagerProvider; import org.gcube.common.security.providers.SecretManagerProvider;
@ -25,7 +23,6 @@ import org.gcube.smartgears.handlers.application.ResponseEvent;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@XmlRootElement(name = Constants.request_validation)
public class RequestValidator extends RequestHandler { public class RequestValidator extends RequestHandler {
private static Logger log = LoggerFactory.getLogger(RequestValidator.class); private static Logger log = LoggerFactory.getLogger(RequestValidator.class);
@ -119,7 +116,7 @@ public class RequestValidator extends RequestHandler {
} }
private void validatePolicy(RequestEvent call){ private void validatePolicy(RequestEvent call){
//TODO: must be re-think //TODO: must be rethought
} }
private Secret getSecret(RequestEvent call){ private Secret getSecret(RequestEvent call){

View File

@ -104,7 +104,7 @@
</div> </div>
<div id="middle"> <div id="middle">
<p>Welcome to <em>${name}</em>,</p> <p>Welcome to <em>${name}</em>,</p>
<p>a resource of the <em>${infra}</em> infrastructure shared in <em>${vos}</em> VOs.</p> <p>a resource of the <em>${infra}</em> infrastructure</p>
<p style="padding-top:30px">The resource is <em>${status}</em>.</p> <p style="padding-top:30px">The resource is <em>${status}</em>.</p>
</div> </div>