Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DARIAH-DE
TextGridRep Portal
Commits
630082c1
Commit
630082c1
authored
May 14, 2020
by
Ubbo Veentjer
Browse files
remove unused code, specify postmapping for basket, cxf to 3.3.6
parent
e85412ee
Pipeline
#134942
passed with stages
in 10 minutes and 6 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
build.gradle
View file @
630082c1
...
...
@@ -23,7 +23,7 @@ dependencies {
implementation
'org.springframework.boot:spring-boot-starter-web'
implementation
'org.apache.tomcat.embed:tomcat-embed-jasper'
implementation
'javax.servlet:jstl'
implementation
'org.apache.cxf:cxf-rt-rs-client:3.3.
4
'
implementation
'org.apache.cxf:cxf-rt-rs-client:3.3.
6
'
implementation
'io.jsonwebtoken:jjwt:0.9.1'
implementation
'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider'
implementation
'com.atlassian.commonmark:commonmark:0.14.0'
...
...
src/main/java/info/textgrid/rep/basket/BasketAjaxController.java
View file @
630082c1
...
...
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
javax.servlet.http.HttpSession
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -14,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
"/service/shelf"
)
public
class
BasketAjaxController
{
@
Reque
stMapping
(
"/add"
)
@
Po
stMapping
(
"/add"
)
public
long
addToBasket
(
HttpSession
session
,
@RequestParam
(
"uri"
)
String
textgridUri
...
...
@@ -33,7 +34,7 @@ public class BasketAjaxController {
}
@
Reque
stMapping
(
"/remove"
)
@
Po
stMapping
(
"/remove"
)
public
long
removeFromBasket
(
HttpSession
session
,
@RequestParam
(
"uri"
)
String
textgridUri
...
...
@@ -45,7 +46,7 @@ public class BasketAjaxController {
return
basket
.
size
();
}
@
Reque
stMapping
(
"/clear"
)
@
Po
stMapping
(
"/clear"
)
public
long
clearBasket
(
HttpSession
session
)
throws
IOException
{
...
...
src/main/java/info/textgrid/rep/shared/Utils.java
View file @
630082c1
package
info.textgrid.rep.shared
;
import
info.textgrid.namespaces.metadata.core._2010.RelationType
;
import
info.textgrid.namespaces.middleware.tgsearch.ResultType
;
//import info.textgrid.service.BasketLocalServiceUtil;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Jws
;
import
io.jsonwebtoken.Jwts
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpSession
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.w3._1999._02._22_rdf_syntax_ns_.RdfType
;
import
org.w3c.dom.Element
;
import
info.textgrid.namespaces.metadata.core._2010.RelationType
;
import
info.textgrid.namespaces.middleware.tgsearch.ResultType
;
...
...
@@ -24,7 +18,6 @@ import org.w3c.dom.Element;
public
class
Utils
{
private
final
static
int
THUMBSIZE
=
250
;
//private final static String BROWSE_URL = "/web/textgrid/browse/-/tgrep/";
private
final
static
String
BROWSE_URL
=
"/browse/"
;
private
final
static
String
SEARCH_URL
=
"/search"
;
...
...
@@ -40,7 +33,6 @@ public class Utils {
}
public
static
String
urlmod
(
String
tgurl
)
{
//System.out.println("urmlod called with uri: " + tgurl);
if
(
tgurl
.
length
()
>
10
)
{
return
tgurl
.
substring
(
9
).
replace
(
'.'
,
'_'
);
}
...
...
@@ -82,13 +74,6 @@ public class Utils {
}
}
public
static
String
getParamWithDefault
(
HttpServletRequest
sr
,
String
param
,
String
defaultString
)
{
if
(
sr
.
getParameter
(
param
)
==
null
)
{
return
defaultString
;
}
return
sr
.
getParameter
(
param
);
}
public
static
String
getFilterQueryString
(
List
<
String
>
filters
)
{
if
(
filters
==
null
)
{
...
...
@@ -128,52 +113,7 @@ public class Utils {
}
return
string
;
}
/*
public static Boolean userWantsSandbox(long userId) {
boolean sandbox = false;
ExpandoValue expandoObject = null;
try {
expandoObject = ExpandoValueLocalServiceUtil.getValue(CompanyThreadLocal.getCompanyId(),
"com.liferay.portal.model.User", "CUSTOM_FIELDS", "textgrid-sandbox-results", userId);
if(expandoObject != null){
sandbox = expandoObject.getBoolean();
}
} catch (SystemException | PortalException e) {
log.error("error reading expandoValue (textgrid-sandbox-results)", e);
}
return sandbox;
}
public static Boolean userWantsAnnotation(long userId) {
boolean annotation = false;
ExpandoValue expandoObject = null;
try {
expandoObject = ExpandoValueLocalServiceUtil.getValue(CompanyThreadLocal.getCompanyId(),
"com.liferay.portal.model.User", "CUSTOM_FIELDS", "textgrid-annotation", userId);
if(expandoObject != null){
annotation = expandoObject.getBoolean();
}
} catch (SystemException | PortalException e) {
log.error("error reading expandoValue (textgrid-annotation)", e);
}
return annotation;
}
public static String getEppn(long userId) {
String eppn = "";
ExpandoValue expandoObject = null;
try {
expandoObject = ExpandoValueLocalServiceUtil.getValue(CompanyThreadLocal.getCompanyId(),
"com.liferay.portal.model.User", "CUSTOM_FIELDS", "eppn", userId);
if(expandoObject != null){
eppn = expandoObject.getString();
}
} catch (SystemException | PortalException e) {
log.error("error reading expandoValue (eppn)", e);
}
return eppn;
}
*/
public
static
String
replaceAll
(
String
string
,
String
pattern
,
String
replacement
)
{
return
string
.
replaceAll
(
pattern
,
replacement
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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