Commit f1430871 authored by abenkaddour's avatar abenkaddour

Add methods and services on urlMaker

parent 72d2e116
Pipeline #3609 failed with stages
in 19 seconds
......@@ -19,6 +19,7 @@
package org.ow2.weblab.portlet.bean;
import java.util.List;
import java.util.Map;
/**
* Bean class representing a Named Entity A named entity has properties like
......@@ -61,6 +62,8 @@ public class NamedEntity {
private String externalUrl;
private String entityMapped;
/**
* Default empty constructor
*/
......@@ -302,4 +305,20 @@ public class NamedEntity {
this.externalUrl = externalUrl;
}
/**
* @return entityMapped
*/
public String getEntityMapped(){
return this.entityMapped;
}
/**
* @param entityMapped
*/
public void setEntityMapped(final String entityMapped){
this.entityMapped = entityMapped;
}
}
......@@ -355,6 +355,7 @@ public class DocumentViewerService {
if (urlMaker != null && urlMaker.isActive().booleanValue()) {
namedEntity.setExternalUrl(urlMaker.make(namedEntity.isCandidate(), namedEntity.getEntityClassURI(), namedEntity.getEntityURI(),namedEntity.getEntityLabels().get(0)));
namedEntity.setEntityMapped(urlMaker.getEntityMapped(namedEntity.getEntityClassURI()));
}
namedEntities.add(namedEntity);
}
......
......@@ -6,6 +6,10 @@
***********************************************************************************/
package org.ow2.weblab.portlet.utils;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
......@@ -14,6 +18,7 @@ package org.ow2.weblab.portlet.utils;
*/
public class DefaultUrlMaker implements IUrlMaker {
protected final Log logger = LogFactory.getLog(this.getClass());
private String defaultUrl = "";
......@@ -75,5 +80,9 @@ public class DefaultUrlMaker implements IUrlMaker {
this.active = active;
}
@Override
public String getEntityMapped(String classUri) {
return classUri;
}
}
......@@ -6,7 +6,6 @@
***********************************************************************************/
package org.ow2.weblab.portlet.utils;
/**
* @author flanglois
* Creation : 8 août 2018
......@@ -20,4 +19,6 @@ public interface IUrlMaker {
* @return
*/
String make(boolean candidate, String classUri, String uri , String label);
String getEntityMapped(final String classUri);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment