Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
dba87907
Commit
dba87907
authored
Oct 30, 2018
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Repository services require sort
parent
457fbbe3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
src/main/java/org/genesys2/server/api/v1/RepositoryController.java
...java/org/genesys2/server/api/v1/RepositoryController.java
+2
-2
src/main/java/org/genesys2/server/mvc/WiewsController.java
src/main/java/org/genesys2/server/mvc/WiewsController.java
+3
-3
src/main/java/org/genesys2/server/mvc/admin/RepositoryController.java
...a/org/genesys2/server/mvc/admin/RepositoryController.java
+2
-2
src/main/java/org/genesys2/spring/config/ApplicationStartup.java
...n/java/org/genesys2/spring/config/ApplicationStartup.java
+1
-1
No files found.
src/main/java/org/genesys2/server/api/v1/RepositoryController.java
View file @
dba87907
...
@@ -283,11 +283,11 @@ public class RepositoryController {
...
@@ -283,11 +283,11 @@ public class RepositoryController {
private
FolderDetails
folderDetails
(
final
Path
path
)
throws
InvalidRepositoryPathException
{
private
FolderDetails
folderDetails
(
final
Path
path
)
throws
InvalidRepositoryPathException
{
FolderDetails
fd
=
new
FolderDetails
();
FolderDetails
fd
=
new
FolderDetails
();
fd
.
folder
=
repositoryService
.
getFolder
(
path
);
fd
.
folder
=
repositoryService
.
getFolder
(
path
);
fd
.
subFolders
=
repositoryService
.
getFolders
(
path
);
fd
.
subFolders
=
repositoryService
.
getFolders
(
path
,
RepositoryFolder
.
DEFAULT_SORT
);
if
(
fd
.
folder
==
null
&&
!
path
.
toAbsolutePath
().
toString
().
equals
(
"/"
))
{
if
(
fd
.
folder
==
null
&&
!
path
.
toAbsolutePath
().
toString
().
equals
(
"/"
))
{
throw
new
ResourceNotFoundException
(
"No such folder"
);
throw
new
ResourceNotFoundException
(
"No such folder"
);
}
}
fd
.
files
=
repositoryService
.
getFiles
(
path
);
fd
.
files
=
repositoryService
.
getFiles
(
path
,
RepositoryFile
.
DEFAULT_SORT
);
fd
.
gallery
=
imagegalleryService
.
loadImageGallery
(
path
);
fd
.
gallery
=
imagegalleryService
.
loadImageGallery
(
path
);
return
fd
;
return
fd
;
}
}
...
...
src/main/java/org/genesys2/server/mvc/WiewsController.java
View file @
dba87907
...
@@ -558,13 +558,13 @@ public class WiewsController extends BaseController {
...
@@ -558,13 +558,13 @@ public class WiewsController extends BaseController {
}
}
List
<
String
>
subPaths
=
new
ArrayList
<>();
List
<
String
>
subPaths
=
new
ArrayList
<>();
for
(
RepositoryFolder
subPath
:
repositoryService
.
listPaths
(
repositoryPath
))
{
for
(
RepositoryFolder
subPath
:
repositoryService
.
listPaths
Recursively
(
repositoryPath
))
{
if
(!
subPath
.
getFolderPath
().
equals
(
repositoryPath
))
{
if
(!
subPath
.
getFolderPath
().
equals
(
repositoryPath
))
{
subPaths
.
add
(
institutePath
.
relativize
(
subPath
.
getFolderPath
()).
toString
());
subPaths
.
add
(
institutePath
.
relativize
(
subPath
.
getFolderPath
()).
toString
());
}
}
}
}
model
.
addAttribute
(
"fileList"
,
repositoryService
.
getFiles
(
repositoryPath
));
model
.
addAttribute
(
"fileList"
,
repositoryService
.
getFiles
(
repositoryPath
,
RepositoryFile
.
DEFAULT_SORT
));
model
.
addAttribute
(
"currentPath"
,
repositoryPath
);
model
.
addAttribute
(
"currentPath"
,
repositoryPath
);
model
.
addAttribute
(
"subPaths"
,
subPaths
);
model
.
addAttribute
(
"subPaths"
,
subPaths
);
model
.
addAttribute
(
"imageGallery"
,
imageGalleryService
.
loadImageGallery
(
repositoryPath
));
model
.
addAttribute
(
"imageGallery"
,
imageGalleryService
.
loadImageGallery
(
repositoryPath
));
...
@@ -745,7 +745,7 @@ public class WiewsController extends BaseController {
...
@@ -745,7 +745,7 @@ public class WiewsController extends BaseController {
response
.
setContentType
(
"text/csv;charset=UTF-16LE"
);
response
.
setContentType
(
"text/csv;charset=UTF-16LE"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
wiewsCode
+
"_files_metadata.csv "
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
wiewsCode
+
"_files_metadata.csv "
);
Stream
<
RepositoryFile
>
files
=
repositoryService
.
streamFiles
(
wiewsPath
);
Stream
<
RepositoryFile
>
files
=
repositoryService
.
streamFiles
(
wiewsPath
,
RepositoryFile
.
DEFAULT_SORT
);
filesMetadataInfo
.
downloadMetadata
(
files
,
response
,
'\t'
,
'"'
,
'\\'
,
"\n"
,
"UTF-16LE"
);
filesMetadataInfo
.
downloadMetadata
(
files
,
response
,
'\t'
,
'"'
,
'\\'
,
"\n"
,
"UTF-16LE"
);
}
}
...
...
src/main/java/org/genesys2/server/mvc/admin/RepositoryController.java
View file @
dba87907
...
@@ -115,11 +115,11 @@ public class RepositoryController extends BaseController {
...
@@ -115,11 +115,11 @@ public class RepositoryController extends BaseController {
}
}
RepositoryFolder
currentFolder
=
repositoryService
.
getFolder
(
path
);
RepositoryFolder
currentFolder
=
repositoryService
.
getFolder
(
path
);
List
<
RepositoryFile
>
fileList
=
repositoryService
.
getFiles
(
path
);
List
<
RepositoryFile
>
fileList
=
repositoryService
.
getFiles
(
path
,
RepositoryFile
.
DEFAULT_SORT
);
model
.
addAttribute
(
"fileList"
,
fileList
);
model
.
addAttribute
(
"fileList"
,
fileList
);
model
.
addAttribute
(
"currentPath"
,
path
);
model
.
addAttribute
(
"currentPath"
,
path
);
model
.
addAttribute
(
"currentFolder"
,
currentFolder
);
model
.
addAttribute
(
"currentFolder"
,
currentFolder
);
model
.
addAttribute
(
"subPaths"
,
repositoryService
.
getFolders
(
path
));
model
.
addAttribute
(
"subPaths"
,
repositoryService
.
getFolders
(
path
,
RepositoryFolder
.
DEFAULT_SORT
));
model
.
addAttribute
(
"imageGallery"
,
imageGalleryService
.
loadImageGallery
(
path
));
model
.
addAttribute
(
"imageGallery"
,
imageGalleryService
.
loadImageGallery
(
path
));
...
...
src/main/java/org/genesys2/spring/config/ApplicationStartup.java
View file @
dba87907
...
@@ -262,7 +262,7 @@ public class ApplicationStartup implements InitializingBean, ApplicationListener
...
@@ -262,7 +262,7 @@ public class ApplicationStartup implements InitializingBean, ApplicationListener
private
void
ensureInsituteFolders
()
throws
Exception
{
private
void
ensureInsituteFolders
()
throws
Exception
{
asAdminInvoker
.
invoke
(()
->
{
asAdminInvoker
.
invoke
(()
->
{
List
<
RepositoryFolder
>
wiewsFolders
=
repositoryService
.
getFolders
(
Paths
.
get
(
"/wiews"
));
List
<
RepositoryFolder
>
wiewsFolders
=
repositoryService
.
getFolders
(
Paths
.
get
(
"/wiews"
)
,
RepositoryFolder
.
DEFAULT_SORT
);
for
(
RepositoryFolder
instFolder:
wiewsFolders
)
{
for
(
RepositoryFolder
instFolder:
wiewsFolders
)
{
LOG
.
warn
(
"Ensuring inheritance for {}"
,
instFolder
.
getFolderPath
());
LOG
.
warn
(
"Ensuring inheritance for {}"
,
instFolder
.
getFolderPath
());
FaoInstitute
institute
=
instituteRepository
.
findByCode
(
instFolder
.
getName
());
FaoInstitute
institute
=
instituteRepository
.
findByCode
(
instFolder
.
getName
());
...
...
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