Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
weblab
portlets
document-viewer
Commits
f1430871
Commit
f1430871
authored
Dec 03, 2018
by
abenkaddour
Browse files
Add methods and services on urlMaker
parent
72d2e116
Pipeline
#3609
failed with stages
in 19 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/bean/NamedEntity.java
View file @
f1430871
...
...
@@ -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
;
}
}
document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/service/DocumentViewerService.java
View file @
f1430871
...
...
@@ -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
);
}
...
...
document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/utils/DefaultUrlMaker.java
View file @
f1430871
...
...
@@ -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
;
}
}
document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/utils/IUrlMaker.java
View file @
f1430871
...
...
@@ -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
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment