Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
knowledge-platform
Commits
cf26e481
Commit
cf26e481
authored
4 years ago
by
Kumar Gauraw
Browse files
Options
Download
Plain Diff
Merge branch 'release-3.1.0' into release-3.0.1
parents
9823fee8
40963610
schema-updates
3.9.0-prod-fix
4.1.0_fixes
AmiableAnil-patch-1
Gcloud_copy
Gcloud_fix
Remove_unwantedCode_Gcloud_fix
actors-test
bulk-upload-comptenecy-mapping
bulk-upload-excelsheet
bulk-upload-test_excel
bulk_upload
code-cleanup
csp-migration
dependabot/maven/platform-core/platform-telemetry/ch.qos.logback-logback-core-1.2.9
dependabot/maven/search-api/search-core/org.apache.httpcomponents-httpclient-4.5.13
ft-spike
knowlg-friday
knowlg-oneclick
local-setup-fix
local-setup-kube
m-4.2.0
master
master-data
new_objecttype
org-target-enhancement
patch-1
patch-2
patch-3
poc_bulk_upload
qs-schema
rahul_bulk_upload_postgres
release-3.1.0
release-3.2.0
release-3.3.0
release-3.4.0
release-3.5.0
release-3.6.0
release-3.6.0.1
release-3.7.0
release-3.8.0
release-3.9.0
release-4.0.0
release-4.1.0
release-4.10.0
release-4.10.1
release-4.2.0
release-4.3.0
release-4.4.0
release-4.5.0
release-4.6.0
release-4.7.0
release-4.7.0-debug
release-4.8.0
release-4.8.0-debug
release-4.9.0
release-4.9.1
release-5.0.0
release-5.0.1
release-5.1.0
release-5.1.0-content
release-5.2.0
release-5.3.0
revert-718-visiblity-private-api
revert-719-assessment-private-read-api
revert-720-visiblity-public-search-api
revert-721-visiblity-private-search-api
review-4.1.0
s-debug
schema-update-4.0
release-5.2.0_RC2
release-5.2.0_RC1
release-5.1.0_RC1
release-5.0.0_RC2
release-5.0.0_RC1
release-4.10.0_RC2
release-4.10.0_RC1
release-4.9.1_RC1
release-4.9.0_RC8
release-4.9.0_RC7
release-4.9.0_RC6
release-4.9.0_RC5
release-4.9.0_RC4
release-4.9.0_RC3
release-4.9.0_RC2
release-4.9.0_RC1
release-4.8.0_RC5
release-4.8.0_RC4
release-4.8.0_RC3
release-4.8.0_RC2
release-4.8.0_RC1
release-4.7.0_RC6
release-4.7.0_RC5
release-4.7.0_RC4
release-4.7.0_RC3
release-4.7.0_RC2
release-4.7.0_RC1
release-4.6.0_RC2
release-4.6.0_RC1
release-4.5.0_RC2
release-4.5.0_RC1
release-4.4.0_RC6
release-4.4.0_RC5
release-4.4.0_RC4
release-4.4.0_RC3
release-4.4.0_RC2
release-4.4.0_RC1
release-4.3.0_RC10
release-4.3.0_RC9
release-4.3.0_RC8
release-4.3.0_RC7
release-4.3.0_RC6
release-4.3.0_RC5
release-4.3.0_RC4
release-4.3.0_RC3
release-4.3.0_RC2
release-4.3.0_RC1
release-4.2.0_RC13
release-4.2.0_RC12
release-4.2.0_RC11
release-4.2.0_RC10
release-4.2.0_RC9
release-4.2.0_RC8
release-4.2.0_RC7
release-4.2.0_RC6
release-4.2.0_RC5
release-4.2.0_RC4
release-4.2.0_RC3
release-4.2.0_RC2
release-4.2.0_RC1
release-4.1.0_RC13
release-4.1.0_RC12
release-4.1.0_RC11
release-4.1.0_RC10
release-4.1.0_RC9
release-4.1.0_RC8
release-4.1.0_RC7
release-4.1.0_RC6
release-4.1.0_RC5
release-4.1.0_RC4
release-4.1.0_RC3
release-4.1.0_RC2
release-4.1.0_RC1
release-4.0.0_RC9
release-4.0.0_RC8
release-4.0.0_RC7
release-4.0.0_RC6
release-4.0.0_RC5
release-4.0.0_RC4
release-4.0.0_RC3
release-4.0.0_RC2
release-4.0.0_RC1
release-3.9.0_RC12
release-3.9.0_RC11
release-3.9.0_RC10
release-3.9.0_RC9
release-3.9.0_RC8
release-3.9.0_RC7
release-3.9.0_RC6
release-3.9.0_RC5
release-3.9.0_RC4
release-3.9.0_RC3
release-3.9.0_RC2
release-3.9.0_RC1
release-3.8.0_RC9
release-3.8.0_RC8
release-3.8.0_RC7
release-3.8.0_RC6
release-3.8.0_RC5
release-3.8.0_RC4
release-3.8.0_RC3
release-3.8.0_RC2
release-3.8.0_RC1
release-3.7.0_RC1
release-3.6.0_RC5
release-3.6.0_RC4
release-3.6.0_RC3
release-3.6.0_RC2
release-3.6.0_RC1
release-3.5.0
release-3.5.0_RC2
release-3.5.0_RC1
release-3.4.0
release-3.4.0_RC2
release-3.4.0_RC1
release-3.3.0_RC10
release-3.3.0_RC9
release-3.3.0_RC8
release-3.3.0_RC7
release-3.3.0_RC6
release-3.3.0_RC5
release-3.3.0_RC4
release-3.3.0_RC3
release-3.3.0_RC2
release-3.3.0_RC1
release-3.2.0_RC9
release-3.2.0_RC8
release-3.2.0_RC7
release-3.2.0_RC6
release-3.2.0_RC5
release-3.2.0_RC4
release-3.2.0_RC3
release-3.2.0_RC2
release-3.2.0_RC1
release-3.1.0
release-3.1.0_RC8
release-3.1.0_RC7
release-3.1.0_RC6
release-3.1.0_RC5
release-3.1.0_RC4
release-3.1.0_RC3
release-3.1.0_RC2
No related merge requests found
Changes
67
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
.circleci/config.yml
+4
-1
.circleci/config.yml
assessment-api/assessment-actors/pom.xml
+17
-11
assessment-api/assessment-actors/pom.xml
assessment-api/assessment-service/app/controllers/BaseController.scala
+6
-5
...i/assessment-service/app/controllers/BaseController.scala
assessment-api/assessment-service/app/controllers/v3/ItemSetController.scala
+5
-5
...ssment-service/app/controllers/v3/ItemSetController.scala
assessment-api/assessment-service/pom.xml
+3
-5
assessment-api/assessment-service/pom.xml
assessment-api/pom.xml
+4
-9
assessment-api/pom.xml
build/assessment-service/Dockerfile
+1
-1
build/assessment-service/Dockerfile
build/assessment-service/Jenkinsfile
+1
-1
build/assessment-service/Jenkinsfile
build/content-service/Dockerfile
+1
-1
build/content-service/Dockerfile
build/content-service/Jenkinsfile
+1
-1
build/content-service/Jenkinsfile
build/search-service/Dockerfile
+1
-1
build/search-service/Dockerfile
build/search-service/Jenkinsfile
+1
-1
build/search-service/Jenkinsfile
build/taxonomy-service/Dockerfile
+1
-1
build/taxonomy-service/Dockerfile
build/taxonomy-service/Jenkinsfile
+1
-1
build/taxonomy-service/Jenkinsfile
content-api/content-actors/pom.xml
+18
-17
content-api/content-actors/pom.xml
content-api/content-actors/src/test/resources/application.conf
+2
-2
...nt-api/content-actors/src/test/resources/application.conf
content-api/content-actors/src/test/scala/org/sunbird/content/util/CopyManagerTest.scala
+1
-4
...test/scala/org/sunbird/content/util/CopyManagerTest.scala
content-api/content-service/app/controllers/BaseController.scala
+9
-8
...-api/content-service/app/controllers/BaseController.scala
content-api/content-service/app/controllers/v3/ChannelController.scala
+1
-2
...ontent-service/app/controllers/v3/ChannelController.scala
content-api/content-service/app/controllers/v3/ContentController.scala
+16
-15
...ontent-service/app/controllers/v3/ContentController.scala
with
94 additions
and
92 deletions
+94
-92
.circleci/config.yml
+
4
−
1
View file @
cf26e481
version
:
2.1
executorType
:
machine
jobs
:
kp-build
:
machine
:
true
docker
:
-
image
:
circleci/openjdk:14-jdk-buster-node-browsers-legacy
-
image
:
circleci/redis:latest
steps
:
-
checkout
-
restore_cache
:
...
...
This diff is collapsed.
Click to expand it.
assessment-api/assessment-actors/pom.xml
+
17
−
11
View file @
cf26e481
...
...
@@ -34,8 +34,8 @@
</dependency>
<dependency>
<groupId>
org.scalatest
</groupId>
<artifactId>
scalatest_
2.11
</artifactId>
<version>
3.0.
8
</version>
<artifactId>
scalatest_
${scala.maj.version}
</artifactId>
<version>
3.0.
6
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
...
...
@@ -45,29 +45,35 @@
<testSourceDirectory>
src/test/scala
</testSourceDirectory>
<plugins>
<plugin>
<!-- see http://davidb.github.com/scala-maven-plugin -->
<groupId>
net.alchim31.maven
</groupId>
<artifactId>
scala-maven-plugin
</artifactId>
<version>
3.2.2
</version>
<version>
4.4.0
</version>
<configuration>
<scalaVersion>
${scala.version}
</scalaVersion>
<checkMultipleScalaVersions>
false
</checkMultipleScalaVersions>
</configuration>
<executions>
<execution>
<id>
scala-compile-first
</id>
<phase>
process-resources
</phase>
<goals>
<goal>
add-source
</goal>
<goal>
compile
</goal>
</goals>
</execution>
<execution>
<id>
scala-test-compile
</id>
<phase>
process-test-resources
</phase>
<goals>
<goal>
testCompile
</goal>
</goals>
<configuration>
<args>
<arg>
-dependencyfile
</arg>
<arg>
${project.build.directory}/.scala_dependencies
</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.scalatest
</groupId>
<artifactId>
scalatest-maven-plugin
</artifactId>
<version>
1
.0
</version>
<version>
2.0
.0
</version>
<executions>
<execution>
<id>
test
</id>
...
...
This diff is collapsed.
Click to expand it.
assessment-api/assessment-service/app/controllers/BaseController.scala
+
6
−
5
View file @
cf26e481
...
...
@@ -10,9 +10,7 @@ import org.sunbird.common.exception.ResponseCode
import
play.api.mvc._
import
utils.JavaJsonUtils
import
scala.collection.JavaConversions._
import
scala.collection.JavaConverters._
import
scala.collection.mutable
import
collection.JavaConverters._
import
scala.concurrent.
{
ExecutionContext
,
Future
}
abstract
class
BaseController
(
protected
val
cc
:
ControllerComponents
)(
implicit
exec
:
ExecutionContext
)
extends
AbstractController
(
cc
)
{
...
...
@@ -31,7 +29,10 @@ abstract class BaseController(protected val cc: ControllerComponents)(implicit e
}
else
{
collection
.
mutable
.
HashMap
[
String
,
Object
]().
asJava
}
}).
flatten
.
toMap
.
asJava
}).
reduce
((
a
,
b
)
=>
{
a
.
putAll
(
b
)
return
a
})
}
def
getRequest
(
input
:
java.util.Map
[
String
,
AnyRef
],
context
:
java.util.Map
[
String
,
AnyRef
],
operation
:
String
)
:
org.sunbird.common.dto.Request
=
{
...
...
@@ -60,7 +61,7 @@ abstract class BaseController(protected val cc: ControllerComponents)(implicit e
}
def
setRequestContext
(
request
:
org.sunbird.common.dto.Request
,
version
:
String
,
objectType
:
String
,
schemaName
:
String
)
:
Unit
=
{
var
contextMap
:
java.util.Map
[
String
,
AnyRef
]
=
new
mutable
.
HashMap
[
String
,
AnyRef
](){{
var
contextMap
:
java.util.Map
[
String
,
AnyRef
]
=
new
java
.
util
.
HashMap
[
String
,
AnyRef
](){{
put
(
"graph_id"
,
"domain"
)
put
(
"version"
,
version
)
put
(
"objectType"
,
objectType
)
...
...
This diff is collapsed.
Click to expand it.
assessment-api/assessment-service/app/controllers/v3/ItemSetController.scala
+
5
−
5
View file @
cf26e481
...
...
@@ -7,7 +7,7 @@ import javax.inject.{Inject, Named}
import
play.api.mvc.ControllerComponents
import
utils.
{
ActorNames
,
ApiId
,
ItemSetOperations
}
import
scala.collection.JavaConver
sion
s._
import
scala.collection.JavaConver
ter
s._
import
scala.concurrent.ExecutionContext
@Singleton
...
...
@@ -20,7 +20,7 @@ class ItemSetController @Inject()(@Named(ActorNames.ITEM_SET_ACTOR) itemSetActor
def
create
()
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
itemset
=
body
.
getOr
Else
(
"itemset"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
AnyRef
]]
val
itemset
=
body
.
getOr
Default
(
"itemset"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
AnyRef
]]
itemset
.
putAll
(
headers
)
val
itemSetRequest
=
getRequest
(
itemset
,
headers
,
ItemSetOperations
.
createItemSet
.
toString
)
setRequestContext
(
itemSetRequest
,
version
,
objectType
,
schemaName
)
...
...
@@ -31,7 +31,7 @@ class ItemSetController @Inject()(@Named(ActorNames.ITEM_SET_ACTOR) itemSetActor
val
headers
=
commonHeaders
()
val
itemset
=
new
java
.
util
.
HashMap
().
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
itemset
.
putAll
(
headers
)
itemset
.
putAll
(
Map
(
"identifier"
->
identifier
,
"fields"
->
fields
.
getOrElse
(
""
)).
as
InstanceOf
[
Map
[
String
,
Object
]]
)
itemset
.
putAll
(
Map
(
"identifier"
->
identifier
,
"fields"
->
fields
.
getOrElse
(
""
)).
as
Java
)
val
itemSetRequest
=
getRequest
(
itemset
,
headers
,
ItemSetOperations
.
readItemSet
.
toString
)
setRequestContext
(
itemSetRequest
,
version
,
objectType
,
schemaName
)
getResult
(
ApiId
.
READ_ITEM_SET
,
itemSetActor
,
itemSetRequest
)
...
...
@@ -40,7 +40,7 @@ class ItemSetController @Inject()(@Named(ActorNames.ITEM_SET_ACTOR) itemSetActor
def
update
(
identifier
:
String
)
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
itemset
=
body
.
getOr
Else
(
"itemset"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]];
val
itemset
=
body
.
getOr
Default
(
"itemset"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]];
itemset
.
putAll
(
headers
)
val
itemSetRequest
=
getRequest
(
itemset
,
headers
,
ItemSetOperations
.
updateItemSet
.
toString
)
setRequestContext
(
itemSetRequest
,
version
,
objectType
,
schemaName
)
...
...
@@ -51,7 +51,7 @@ class ItemSetController @Inject()(@Named(ActorNames.ITEM_SET_ACTOR) itemSetActor
def
review
(
identifier
:
String
)
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
itemset
=
body
.
getOr
Else
(
"itemset"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]];
val
itemset
=
body
.
getOr
Default
(
"itemset"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]];
itemset
.
putAll
(
headers
)
val
itemSetRequest
=
getRequest
(
itemset
,
headers
,
ItemSetOperations
.
reviewItemSet
.
toString
)
setRequestContext
(
itemSetRequest
,
version
,
objectType
,
schemaName
)
...
...
This diff is collapsed.
Click to expand it.
assessment-api/assessment-service/pom.xml
+
3
−
5
View file @
cf26e481
...
...
@@ -34,8 +34,6 @@
<play2.version>
2.7.2
</play2.version>
<play2.plugin.version>
1.0.0-rc5
</play2.plugin.version>
<sbt-compiler.plugin.version>
1.0.0
</sbt-compiler.plugin.version>
<scala.major.version>
2.11
</scala.major.version>
<scala.version>
2.11.8
</scala.version>
</properties>
<dependencies>
...
...
@@ -79,8 +77,8 @@
</dependency>
<dependency>
<groupId>
org.scalatest
</groupId>
<artifactId>
scalatest_
2.11
</artifactId>
<version>
3.
0.8
</version>
<artifactId>
scalatest_
${scala.maj.version}
</artifactId>
<version>
3.
1.2
</version>
<scope>
test
</scope>
</dependency>
<dependency>
...
...
@@ -107,7 +105,7 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.22.0
</version>
<version>
3.0.0-M4
</version>
<configuration>
<includes>
<include>
**/*Spec.java
</include>
...
...
This diff is collapsed.
Click to expand it.
assessment-api/pom.xml
+
4
−
9
View file @
cf26e481
...
...
@@ -17,13 +17,9 @@
</modules>
<properties>
<version.compiler.plugin>
2.3.1
</version.compiler.plugin>
<maven.compiler.target>
1.8
</maven.compiler.target>
<maven.compiler.source>
1.8
</maven.compiler.source>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<scoverage.plugin.version>
1.1.1
</scoverage.plugin.version>
<scala.version>
2.11.8
</scala.version>
<scala.major.version>
2.11
</scala.major.version>
</properties>
<build>
...
...
@@ -31,7 +27,7 @@
<plugins>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
2
.3
</version>
<version>
3
.3
.0
</version>
<configuration>
<descriptors>
<descriptor>
src/assembly/bin.xml
</descriptor>
...
...
@@ -41,10 +37,9 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
2.3.2
</version>
<version>
3.8.1
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
<release>
11
</release>
</configuration>
</plugin>
<plugin>
...
...
This diff is collapsed.
Click to expand it.
build/assessment-service/Dockerfile
+
1
−
1
View file @
cf26e481
FROM
openjdk:8-jre-alpine
FROM
sunbird/openjdk-java11-alpine:latest
RUN
apk update
\
&&
apk add unzip
\
&&
apk add curl
\
...
...
This diff is collapsed.
Click to expand it.
build/assessment-service/Jenkinsfile
+
1
−
1
View file @
cf26e481
node
(
'
build-slave
'
)
{
node
(
'
slave-java11
'
)
{
try
{
String
ANSI_GREEN
=
"\u001B[32m"
String
ANSI_NORMAL
=
"\u001B[0m"
...
...
This diff is collapsed.
Click to expand it.
build/content-service/Dockerfile
+
1
−
1
View file @
cf26e481
FROM
openjdk:8-jre-alpine
FROM
sunbird/openjdk-java11-alpine:latest
RUN
apk update
\
&&
apk add unzip
\
&&
apk add curl
\
...
...
This diff is collapsed.
Click to expand it.
build/content-service/Jenkinsfile
+
1
−
1
View file @
cf26e481
node
(
'
build-slave
'
)
{
node
(
'
slave-java11
'
)
{
try
{
String
ANSI_GREEN
=
"\u001B[32m"
String
ANSI_NORMAL
=
"\u001B[0m"
...
...
This diff is collapsed.
Click to expand it.
build/search-service/Dockerfile
+
1
−
1
View file @
cf26e481
FROM
openjdk:8-jre-alpine
FROM
sunbird/openjdk-java11-alpine:latest
RUN
apk update
\
&&
apk add unzip
\
&&
apk add curl
\
...
...
This diff is collapsed.
Click to expand it.
build/search-service/Jenkinsfile
+
1
−
1
View file @
cf26e481
node
(
'
build-slave
'
)
{
node
(
'
slave-java11
'
)
{
try
{
String
ANSI_GREEN
=
"\u001B[32m"
String
ANSI_NORMAL
=
"\u001B[0m"
...
...
This diff is collapsed.
Click to expand it.
build/taxonomy-service/Dockerfile
+
1
−
1
View file @
cf26e481
FROM
openjdk:8-jre-alpine
FROM
sunbird/openjdk-java11-alpine:latest
RUN
apk update
\
&&
apk add unzip
\
&&
apk add curl
\
...
...
This diff is collapsed.
Click to expand it.
build/taxonomy-service/Jenkinsfile
+
1
−
1
View file @
cf26e481
node
(
'
build-slave
'
)
{
node
(
'
slave-java11
'
)
{
try
{
String
ANSI_GREEN
=
"\u001B[32m"
String
ANSI_NORMAL
=
"\u001B[0m"
...
...
This diff is collapsed.
Click to expand it.
content-api/content-actors/pom.xml
+
18
−
17
View file @
cf26e481
...
...
@@ -38,14 +38,9 @@
<version>
1.0-SNAPSHOT
</version>
<type>
jar
</type>
</dependency>
<dependency>
<groupId>
org.sunbird
</groupId>
<artifactId>
hierarchy-manager
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.scalatest
</groupId>
<artifactId>
scalatest_
2.11
</artifactId>
<artifactId>
scalatest_
${scala.maj.version}
</artifactId>
<version>
3.0.8
</version>
<scope>
test
</scope>
</dependency>
...
...
@@ -61,13 +56,13 @@
</dependency>
<dependency>
<groupId>
org.scalamock
</groupId>
<artifactId>
scalamock_
2.11
</artifactId>
<artifactId>
scalamock_
${scala.maj.version}
</artifactId>
<version>
4.4.0
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.typesafe.akka
</groupId>
<artifactId>
akka-testkit_
2.11
</artifactId>
<artifactId>
akka-testkit_
${scala.maj.version}
</artifactId>
<version>
2.5.22
</version>
<scope>
test
</scope>
</dependency>
...
...
@@ -78,29 +73,35 @@
<testSourceDirectory>
src/test/scala
</testSourceDirectory>
<plugins>
<plugin>
<!-- see http://davidb.github.com/scala-maven-plugin -->
<groupId>
net.alchim31.maven
</groupId>
<artifactId>
scala-maven-plugin
</artifactId>
<version>
3.2.2
</version>
<version>
4.4.0
</version>
<configuration>
<scalaVersion>
${scala.version}
</scalaVersion>
<checkMultipleScalaVersions>
false
</checkMultipleScalaVersions>
</configuration>
<executions>
<execution>
<id>
scala-compile-first
</id>
<phase>
process-resources
</phase>
<goals>
<goal>
add-source
</goal>
<goal>
compile
</goal>
</goals>
</execution>
<execution>
<id>
scala-test-compile
</id>
<phase>
process-test-resources
</phase>
<goals>
<goal>
testCompile
</goal>
</goals>
<configuration>
<args>
<arg>
-dependencyfile
</arg>
<arg>
${project.build.directory}/.scala_dependencies
</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.scalatest
</groupId>
<artifactId>
scalatest-maven-plugin
</artifactId>
<version>
1
.0
</version>
<version>
2.0
.0
</version>
<executions>
<execution>
<id>
test
</id>
...
...
This diff is collapsed.
Click to expand it.
content-api/content-actors/src/test/resources/application.conf
+
2
−
2
View file @
cf26e481
...
...
@@ -470,8 +470,8 @@ content.keyspace = "content_store"
collection
.
image
.
migration
.
enabled
=
true
content
.
tagging
.
backward_enable
=
false
content
.
tagging
.
property
=
"subject,medium"
cloud_storage
.
upload
.
url
.
ttl
=
600
content
.
copy
.
invalid_statusList
=[
"Flagged"
,
"FlaggedDraft"
,
"FraggedReview"
,
"Retired"
,
"Processing"
]
...
...
This diff is collapsed.
Click to expand it.
content-api/content-actors/src/test/scala/org/sunbird/content/util/CopyManagerTest.scala
+
1
−
4
View file @
cf26e481
...
...
@@ -12,10 +12,7 @@ import org.sunbird.graph.{GraphService, OntologyEngineContext}
import
org.sunbird.graph.dac.model.Node
import
scala.collection.JavaConversions.mapAsJavaMap
import
scala.concurrent.ExecutionContext.Implicits.global
import
scala.concurrent.
{
ExecutionContext
,
Future
}
import
scala.concurrent.Future
class
CopyManagerTest
extends
AsyncFlatSpec
with
Matchers
with
AsyncMockFactory
{
...
...
This diff is collapsed.
Click to expand it.
content-api/content-service/app/controllers/BaseController.scala
+
9
−
8
View file @
cf26e481
...
...
@@ -14,9 +14,7 @@ import org.sunbird.common.exception.{ClientException, ResponseCode}
import
play.api.mvc._
import
utils.JavaJsonUtils
import
scala.collection.JavaConversions._
import
scala.collection.JavaConverters._
import
scala.collection.mutable
import
scala.concurrent.
{
ExecutionContext
,
Future
}
abstract
class
BaseController
(
protected
val
cc
:
ControllerComponents
)(
implicit
exec
:
ExecutionContext
)
extends
AbstractController
(
cc
)
{
...
...
@@ -32,19 +30,19 @@ abstract class BaseController(protected val cc: ControllerComponents)(implicit e
val
multipartData
=
request
.
body
.
asMultipartFormData
.
get
if
(
null
!=
multipartData
.
asFormUrlEncoded
&&
!
multipartData
.
asFormUrlEncoded
.
isEmpty
)
{
if
(
multipartData
.
asFormUrlEncoded
.
getOrElse
(
"fileUrl"
,
Seq
()).
length
>
0
){
val
fileUrl
:
String
=
multipartData
.
asFormUrlEncoded
.
getOrElse
(
"fileUrl"
,
Seq
()).
get
(
0
)
val
fileUrl
:
String
=
multipartData
.
asFormUrlEncoded
.
getOrElse
(
"fileUrl"
,
Seq
()).
head
if
(
StringUtils
.
isNotBlank
(
fileUrl
))
reqMap
.
put
(
"fileUrl"
,
fileUrl
)
}
if
(
multipartData
.
asFormUrlEncoded
.
getOrElse
(
"filePath"
,
Seq
()).
length
>
0
){
val
filePath
:
String
=
multipartData
.
asFormUrlEncoded
.
getOrElse
(
"filePath"
,
Seq
()).
get
(
0
)
val
filePath
:
String
=
multipartData
.
asFormUrlEncoded
.
getOrElse
(
"filePath"
,
Seq
()).
head
if
(
StringUtils
.
isNotBlank
(
filePath
))
reqMap
.
put
(
"filePath"
,
filePath
)
}
}
if
(
null
!=
multipartData
.
files
&&
!
multipartData
.
files
.
isEmpty
)
{
val
file
:
File
=
new
File
(
"/tmp"
+
File
.
separator
+
request
.
body
.
asMultipartFormData
.
get
.
files
.
get
(
0
)
.
filename
)
multipartData
.
files
.
get
(
0
)
.
ref
.
copyTo
(
file
,
false
)
val
file
:
File
=
new
File
(
"/tmp"
+
File
.
separator
+
request
.
body
.
asMultipartFormData
.
get
.
files
.
head
.
filename
)
multipartData
.
files
.
head
.
ref
.
copyTo
(
file
,
false
)
reqMap
.
put
(
"file"
,
file
)
}
}
...
...
@@ -64,7 +62,10 @@ abstract class BaseController(protected val cc: ControllerComponents)(implicit e
}
else
{
collection
.
mutable
.
HashMap
[
String
,
Object
]().
asJava
}
}).
flatten
.
toMap
.
asJava
}).
reduce
((
a
,
b
)
=>
{
a
.
putAll
(
b
)
return
a
})
}
def
getRequest
(
input
:
java.util.Map
[
String
,
AnyRef
],
context
:
java.util.Map
[
String
,
AnyRef
],
operation
:
String
)
:
org.sunbird.common.dto.Request
=
{
...
...
@@ -94,7 +95,7 @@ abstract class BaseController(protected val cc: ControllerComponents)(implicit e
}
def
setRequestContext
(
request
:
org.sunbird.common.dto.Request
,
version
:
String
,
objectType
:
String
,
schemaName
:
String
)
:
Unit
=
{
var
contextMap
:
java.util.Map
[
String
,
AnyRef
]
=
new
mutable
.
HashMap
[
String
,
AnyRef
](){{
var
contextMap
:
java.util.Map
[
String
,
AnyRef
]
=
new
java
.
util
.
HashMap
[
String
,
AnyRef
](){{
put
(
"graph_id"
,
"domain"
)
put
(
"version"
,
version
)
put
(
"objectType"
,
objectType
)
...
...
This diff is collapsed.
Click to expand it.
content-api/content-service/app/controllers/v3/ChannelController.scala
+
1
−
2
View file @
cf26e481
...
...
@@ -7,7 +7,6 @@ import javax.inject.{Inject, Named}
import
play.api.mvc.ControllerComponents
import
utils.
{
ActorNames
,
ApiId
}
import
scala.collection.JavaConversions._
import
scala.concurrent.
{
ExecutionContext
}
@Singleton
...
...
@@ -40,7 +39,7 @@ class ChannelController @Inject()(@Named(ActorNames.CHANNEL_ACTOR) channelActor
def
update
(
identifier
:
String
)
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
(
Option
(
List
(
"x-channel-id"
)))
val
body
=
requestBody
()
val
channel
=
body
.
getOr
Else
(
"channel"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
val
channel
=
body
.
getOr
Default
(
"channel"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
channel
.
putAll
(
headers
)
val
channelRequest
=
getRequest
(
channel
,
headers
,
"updateChannel"
)
setRequestContext
(
channelRequest
,
version
,
objectType
,
schemaName
)
...
...
This diff is collapsed.
Click to expand it.
content-api/content-service/app/controllers/v3/ContentController.scala
+
16
−
15
View file @
cf26e481
...
...
@@ -7,7 +7,8 @@ import javax.inject.{Inject, Named}
import
org.sunbird.common.dto.ResponseHandler
import
play.api.mvc.ControllerComponents
import
utils.
{
ActorNames
,
ApiId
,
JavaJsonUtils
}
import
scala.collection.JavaConversions._
import
scala.collection.JavaConverters._
import
scala.concurrent.
{
ExecutionContext
,
Future
}
@Singleton
...
...
@@ -20,7 +21,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
def
create
()
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
content
=
body
.
getOr
Else
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]];
val
content
=
body
.
getOr
Default
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]];
content
.
putAll
(
headers
)
val
contentRequest
=
getRequest
(
content
,
headers
,
"createContent"
)
setRequestContext
(
contentRequest
,
version
,
objectType
,
schemaName
)
...
...
@@ -43,7 +44,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val
headers
=
commonHeaders
()
val
content
=
new
java
.
util
.
HashMap
().
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
content
.
putAll
(
headers
)
content
.
putAll
(
Map
(
"identifier"
->
identifier
,
"mode"
->
mode
.
getOrElse
(
"read"
),
"fields"
->
fields
.
getOrElse
(
""
)).
as
InstanceOf
[
Map
[
String
,
Object
]]
)
content
.
putAll
(
Map
(
"identifier"
->
identifier
,
"mode"
->
mode
.
getOrElse
(
"read"
),
"fields"
->
fields
.
getOrElse
(
""
)).
as
Java
)
val
readRequest
=
getRequest
(
content
,
headers
,
"readContent"
)
setRequestContext
(
readRequest
,
version
,
objectType
,
schemaName
)
getResult
(
ApiId
.
READ_CONTENT
,
contentActor
,
readRequest
)
...
...
@@ -52,7 +53,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
def
update
(
identifier
:
String
)
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
content
=
body
.
getOr
Else
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]];
val
content
=
body
.
getOr
Default
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]];
content
.
putAll
(
headers
)
val
contentRequest
=
getRequest
(
content
,
headers
,
"updateContent"
)
setRequestContext
(
contentRequest
,
version
,
objectType
,
schemaName
)
...
...
@@ -83,7 +84,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
def
updateHierarchy
()
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
data
=
body
.
getOr
Else
(
"data"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
val
data
=
body
.
getOr
Default
(
"data"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
data
.
putAll
(
headers
)
val
contentRequest
=
getRequest
(
data
,
headers
,
"updateHierarchy"
)
setRequestContext
(
contentRequest
,
version
,
objectType
,
schemaName
)
...
...
@@ -94,7 +95,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val
headers
=
commonHeaders
()
val
content
=
new
java
.
util
.
HashMap
().
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
content
.
putAll
(
headers
)
content
.
putAll
(
Map
(
"rootId"
->
identifier
,
"mode"
->
mode
.
getOrElse
(
""
)))
content
.
putAll
(
Map
(
"rootId"
->
identifier
,
"mode"
->
mode
.
getOrElse
(
""
))
.
asJava
)
val
readRequest
=
getRequest
(
content
,
headers
,
"getHierarchy"
)
setRequestContext
(
readRequest
,
version
,
objectType
,
null
)
getResult
(
ApiId
.
GET_HIERARCHY
,
collectionActor
,
readRequest
)
...
...
@@ -104,7 +105,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val
headers
=
commonHeaders
()
val
content
=
new
java
.
util
.
HashMap
().
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
content
.
putAll
(
headers
)
content
.
putAll
(
Map
(
"rootId"
->
identifier
,
"bookmarkId"
->
bookmarkId
,
"mode"
->
mode
.
getOrElse
(
""
)))
content
.
putAll
(
Map
(
"rootId"
->
identifier
,
"bookmarkId"
->
bookmarkId
,
"mode"
->
mode
.
getOrElse
(
""
))
.
asJava
)
val
readRequest
=
getRequest
(
content
,
headers
,
"getHierarchy"
)
setRequestContext
(
readRequest
,
version
,
objectType
,
null
)
getResult
(
ApiId
.
GET_HIERARCHY
,
collectionActor
,
readRequest
)
...
...
@@ -115,7 +116,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val
body
=
requestBody
()
val
content
=
body
content
.
putAll
(
headers
)
content
.
putAll
(
Map
(
"identifier"
->
identifier
))
content
.
putAll
(
Map
(
"identifier"
->
identifier
)
.
asJava
)
val
contentRequest
=
getRequest
(
content
,
headers
,
"flagContent"
)
setRequestContext
(
contentRequest
,
version
,
objectType
,
schemaName
)
contentRequest
.
getContext
.
put
(
"identifier"
,
identifier
)
...
...
@@ -126,7 +127,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val
headers
=
commonHeaders
()
val
content
=
new
java
.
util
.
HashMap
().
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
content
.
putAll
(
headers
)
content
.
putAll
(
Map
(
"identifier"
->
identifier
))
content
.
putAll
(
Map
(
"identifier"
->
identifier
)
.
asJava
)
val
acceptRequest
=
getRequest
(
content
,
headers
,
"acceptFlag"
)
setRequestContext
(
acceptRequest
,
version
,
objectType
,
schemaName
)
getResult
(
ApiId
.
ACCEPT_FLAG
,
contentActor
,
acceptRequest
)
...
...
@@ -160,7 +161,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
val
headers
=
commonHeaders
()
val
content
=
new
java
.
util
.
HashMap
().
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
content
.
putAll
(
headers
)
content
.
putAll
(
Map
(
"identifier"
->
identifier
))
content
.
putAll
(
Map
(
"identifier"
->
identifier
)
.
asJava
)
val
discardRequest
=
getRequest
(
content
,
headers
,
"discardContent"
)
setRequestContext
(
discardRequest
,
version
,
objectType
,
schemaName
)
getResult
(
ApiId
.
DISCARD_CONTENT
,
contentActor
,
discardRequest
)
...
...
@@ -168,7 +169,7 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
def
retire
(
identifier
:
String
)
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
content
=
body
.
getOr
Else
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
val
content
=
body
.
getOr
Default
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
content
.
put
(
"identifier"
,
identifier
)
content
.
putAll
(
headers
)
val
contentRequest
=
getRequest
(
content
,
headers
,
"retireContent"
)
...
...
@@ -235,9 +236,9 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
def
copy
(
identifier
:
String
,
mode
:
Option
[
String
],
copyType
:
String
)
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
content
=
body
.
getOr
Else
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
val
content
=
body
.
getOr
Default
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
content
.
putAll
(
headers
)
content
.
putAll
(
Map
(
"identifier"
->
identifier
,
"mode"
->
mode
.
getOrElse
(
""
),
"copyType"
->
copyType
))
content
.
putAll
(
Map
(
"identifier"
->
identifier
,
"mode"
->
mode
.
getOrElse
(
""
),
"copyType"
->
copyType
)
.
asJava
)
val
contentRequest
=
getRequest
(
content
,
headers
,
"copy"
)
setRequestContext
(
contentRequest
,
version
,
objectType
,
schemaName
)
getResult
(
ApiId
.
COPY_CONTENT
,
contentActor
,
contentRequest
)
...
...
@@ -246,9 +247,9 @@ class ContentController @Inject()(@Named(ActorNames.CONTENT_ACTOR) contentActor:
def
uploadPreSigned
(
identifier
:
String
,
`type`
:
Option
[
String
])
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
content
=
body
.
getOr
Else
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
val
content
=
body
.
getOr
Default
(
"content"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
Object
]]
content
.
putAll
(
headers
)
content
.
putAll
(
Map
(
"identifier"
->
identifier
,
"type"
->
`type`
.
getOrElse
(
"assets"
)))
content
.
putAll
(
Map
(
"identifier"
->
identifier
,
"type"
->
`type`
.
getOrElse
(
"assets"
))
.
asJava
)
val
contentRequest
=
getRequest
(
content
,
headers
,
"uploadPreSignedUrl"
)
setRequestContext
(
contentRequest
,
version
,
objectType
,
schemaName
)
getResult
(
ApiId
.
UPLOAD_PRE_SIGNED_CONTENT
,
contentActor
,
contentRequest
)
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
Next
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets