Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
S
searchitect
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Searchitect
searchitect
Commits
9355f4e6
Commit
9355f4e6
authored
Aug 30, 2019
by
Mat
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/doc' into develop
parents
fe0c2a08
8f84b28e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
13 deletions
+61
-13
searchitect-common/pom.xml
searchitect-common/pom.xml
+6
-1
searchitect-common/src/main/java/searchitect/common/clusion/TextExtractPar.java
.../main/java/searchitect/common/clusion/TextExtractPar.java
+8
-6
searchitect-common/src/main/java/searchitect/common/clusion/TextProc.java
...on/src/main/java/searchitect/common/clusion/TextProc.java
+4
-2
searchitect-common/src/main/java/searchitect/common/view/UserAuthRequest.java
...rc/main/java/searchitect/common/view/UserAuthRequest.java
+6
-0
searchitect-gate/src/main/java/searchitect/controller/CheckController.java
...src/main/java/searchitect/controller/CheckController.java
+26
-3
searchitect-gate/src/main/java/searchitect/controller/RepositoryController.java
...ain/java/searchitect/controller/RepositoryController.java
+11
-1
No files found.
searchitect-common/pom.xml
View file @
9355f4e6
...
...
@@ -88,6 +88,11 @@
<artifactId>
poi-ooxml
</artifactId>
<version>
3.15-beta1
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.7.0
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
@@ -108,4 +113,4 @@
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
</project>
searchitect-common/src/main/java/searchitect/common/clusion/TextExtractPar.java
View file @
9355f4e6
...
...
@@ -78,15 +78,17 @@ public class TextExtractPar implements Serializable {
public
static
int
maxTupleSize
=
0
;
public
static
int
threshold
=
100
;
// lookup stores a plaintext inverted index of the dataset, i.e., the
// association between the keyword and documents that contain the keyword
/**
* lookup stores a plaintext inverted index of the dataset, i.e., the
* association between the keyword and documents that contain the keyword
*/
Multimap
<
String
,
String
>
lookup1
=
ArrayListMultimap
.
create
();
public
static
Multimap
<
String
,
String
>
lp1
=
ArrayListMultimap
.
create
();
// lookup2 stores the document identifier (title) and the keywords contained
// in this document
/**
* lookup2 stores the document identifier (title) and the keywords contained
* in this document
*/
Multimap
<
String
,
String
>
lookup2
=
ArrayListMultimap
.
create
();
public
static
Multimap
<
String
,
String
>
lp2
=
ArrayListMultimap
.
create
();
...
...
searchitect-common/src/main/java/searchitect/common/clusion/TextProc.java
View file @
9355f4e6
...
...
@@ -77,11 +77,13 @@ public class TextProc {
}
}
/*
/*
*
* This method gets all files from a directory. These files, will be
* processed later on to get all the keywords and create an inverted index
* structure
* @param directoryName
* @param files
*/
public
static
void
listf
(
String
directoryName
,
ArrayList
<
File
>
files
)
{
File
directory
=
new
File
(
directoryName
);
...
...
searchitect-common/src/main/java/searchitect/common/view/UserAuthRequest.java
View file @
9355f4e6
...
...
@@ -2,13 +2,19 @@ package searchitect.common.view;
import
javax.xml.bind.annotation.XmlRootElement
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* UserAuthRequest - json object used to pass credentials for authentication
*
*/
@XmlRootElement
@ApiModel
(
value
=
"User credentials"
)
public
class
UserAuthRequest
{
@ApiModelProperty
(
value
=
"The username"
)
private
String
username
;
@ApiModelProperty
(
value
=
"The password"
)
private
String
password
;
public
UserAuthRequest
(
String
username
,
String
password
)
{
...
...
searchitect-gate/src/main/java/searchitect/controller/CheckController.java
View file @
9355f4e6
...
...
@@ -3,6 +3,10 @@ package searchitect.controller;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
searchitect.util.UrlBuilderService
;
import
java.security.Principal
;
...
...
@@ -42,17 +46,36 @@ public class CheckController {
}
@ApiOperation
(
value
=
"Checks if a SE backend is online"
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"A welcome message from the backend."
),
@ApiResponse
(
code
=
403
,
message
=
""
),
@ApiResponse
(
code
=
404
,
message
=
""
),
})
@RequestMapping
(
value
=
"/checkbackend/{b_id}"
,
method
=
RequestMethod
.
GET
)
public
String
checkSebackend
(
@PathVariable
(
"b_id"
)
String
backendName
)
{
public
String
checkSebackend
(
@ApiParam
(
value
=
"Name of the backend to check"
)
@PathVariable
(
"b_id"
)
String
backendName
)
{
String
url
=
urlBuilder
.
getTargetUrl
(
backendName
,
""
,
""
,
""
);
String
response
=
restTemplate
.
getForObject
(
url
,
String
.
class
);
return
response
;
}
@ApiOperation
(
value
=
"Checks if a SE backend is online for an authenticated user"
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"A welcome message from the backend."
),
@ApiResponse
(
code
=
403
,
message
=
""
),
@ApiResponse
(
code
=
404
,
message
=
""
),
})
@RequestMapping
(
value
=
"/checkauthbackend/{b_id}"
,
method
=
RequestMethod
.
GET
)
public
ResponseEntity
<
String
>
checkAuthenticated
(
@AuthenticationPrincipal
Principal
principal
,
@PathVariable
(
"b_id"
)
String
backendName
)
{
public
ResponseEntity
<
String
>
checkAuthenticated
(
@AuthenticationPrincipal
Principal
principal
,
@ApiParam
(
value
=
"Name of the backend to check"
)
@PathVariable
(
"b_id"
)
String
backendName
)
{
String
url
=
urlBuilder
.
getTargetUrl
(
backendName
,
""
,
""
,
""
);
String
response
=
restTemplate
.
getForObject
(
url
,
String
.
class
);
String
name
=
principal
.
getName
();
...
...
searchitect-gate/src/main/java/searchitect/controller/RepositoryController.java
View file @
9355f4e6
...
...
@@ -24,6 +24,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
searchitect.model.UserEDB
;
import
searchitect.common.exception.SearchitectException
;
import
searchitect.model.UserAccount
;
...
...
@@ -32,6 +35,7 @@ import searchitect.service.UserAccountRepository;
import
searchitect.util.UrlBuilderService
;
@RestController
@Api
(
tags
=
{
"Manage SE repositories on the available backends"
})
public
class
RepositoryController
{
private
final
EDBRepository
eDBRepository
;
...
...
@@ -95,9 +99,15 @@ public class RepositoryController {
* @param backendName
* @return
*/
@ApiOperation
(
value
=
"Create a new repository in a backend"
)
@RequestMapping
(
value
=
"/backend/{b_id}/repository"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
String
>
forwardSetup
(
@AuthenticationPrincipal
Principal
principal
,
@RequestBody
String
postData
,
@PathVariable
(
"b_id"
)
String
backendName
)
{
@ApiParam
(
value
=
"Data to forward to the backend"
)
@RequestBody
String
postData
,
@PathVariable
(
"b_id"
)
String
backendName
)
{
try
{
String
targetUrl
=
this
.
urlBuilder
.
getTargetUrl
(
backendName
,
"repository"
,
""
,
""
);
String
response
=
postResponseStringFromBackend
(
postData
,
targetUrl
);
...
...
Write
Preview
Markdown
is supported
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