Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content-api/collection-csv-actors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</dependency>
<dependency>
<groupId>org.sunbird</groupId>
<artifactId>graph-engine_2.12</artifactId>
<artifactId>graph-engine_2.13</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
Expand Down Expand Up @@ -78,9 +78,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${scala.maj.version}</artifactId>
<version>2.5.22</version>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-testkit_${scala.maj.version}</artifactId>
<version>1.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import org.sunbird.managers.HierarchyManager
import org.sunbird.telemetry.logger.TelemetryManager

import javax.inject.Inject
import scala.collection.JavaConverters.mapAsJavaMapConverter
import scala.collection.immutable.{HashMap, Map}
import scala.jdk.CollectionConverters._
import scala.concurrent.{ExecutionContext, Future}

class CollectionCSVActor @Inject() (implicit oec: OntologyEngineContext, ss: StorageService) extends BaseActor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ import java.nio.charset.StandardCharsets
import java.util
import java.util.logging.Logger
import scala.collection.immutable.{ListMap, Map}
import scala.collection.convert.ImplicitConversions._
import scala.collection.JavaConverters.{asJavaIterableConverter, mapAsScalaMapConverter}
import scala.jdk.CollectionConverters._
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.concurrent.{ExecutionContext, Future}

import scala.collection.JavaConverters._

object CollectionCSVManager extends CollectionInputFileReader {

Expand Down Expand Up @@ -239,7 +237,7 @@ object CollectionCSVManager extends CollectionInputFileReader {
}

private def populateFolderInfoMap(folderInfoMap: mutable.Map[String, AnyRef], csvRecords: util.List[CSVRecord], mode: String): Unit = {
csvRecords.map(csvRecord => {
csvRecords.asScala.map(csvRecord => {
val csvRecordFolderHierarchyMap: Map[String, String] = csvRecord.toMap.asScala.toMap.filter(colData => {
folderHierarchyHdrColumnsList.contains(colData._1) && colData._2.nonEmpty
})
Expand All @@ -258,11 +256,11 @@ object CollectionCSVManager extends CollectionInputFileReader {
if(nodeInfoMap.contains(CollectionTOCConstants.CHILDREN))
{
var childrenSet = nodeInfoMap(CollectionTOCConstants.CHILDREN).asInstanceOf[Seq[String]]
childrenSet ++= Seq(getCode(sortedFoldersDataList.get(sortedFoldersDataKey.indexOf(folderData._1)+1)))
childrenSet ++= Seq(getCode(sortedFoldersDataList(sortedFoldersDataKey.indexOf(folderData._1)+1)))
nodeInfoMap(CollectionTOCConstants.CHILDREN) = childrenSet
}
else {
val childrenList = Seq(getCode(sortedFoldersDataList.get(sortedFoldersDataKey.indexOf(folderData._1)+1)))
val childrenList = Seq(getCode(sortedFoldersDataList(sortedFoldersDataKey.indexOf(folderData._1)+1)))
nodeInfoMap += (CollectionTOCConstants.CHILDREN -> childrenList)
}
folderInfoMap(folderDataHashCode) = nodeInfoMap
Expand Down Expand Up @@ -304,7 +302,7 @@ object CollectionCSVManager extends CollectionInputFileReader {
else {
val childrenList = {
if((sortedFoldersDataKey.indexOf(folderData._1)+1) != sortedFoldersDataList.size)
Seq(getCode(sortedFoldersDataList.get(sortedFoldersDataKey.indexOf(folderData._1)+1)))
Seq(getCode(sortedFoldersDataList(sortedFoldersDataKey.indexOf(folderData._1)+1)))
else Seq.empty[String]
}
scala.collection.mutable.Map(CollectionTOCConstants.NAME -> folderData._2, CollectionTOCConstants.CHILDREN -> childrenList, CollectionTOCConstants.LEVEL -> folderData._1)
Expand Down Expand Up @@ -470,9 +468,9 @@ object CollectionCSVManager extends CollectionInputFileReader {
if(nodeInfo(CollectionTOCConstants.DIAL_CODES) != null && nodeInfo(CollectionTOCConstants.DIAL_CODES).toString.nonEmpty)
new util.HashMap[String, String]{put(CollectionTOCConstants.IDENTIFIER, nodeInfo(CollectionTOCConstants.IDENTIFIER).toString); put(CollectionTOCConstants.DIALCODE, nodeInfo(CollectionTOCConstants.DIAL_CODES).toString)}
else new util.HashMap[String, String]()
}).filter(record => record.nonEmpty).toList
}).filter(record => !record.isEmpty).toList

if(linkDIALCodeReqMap.nonEmpty) linkDIALCode(channelID, collectionID, linkDIALCodeReqMap)
if(!linkDIALCodeReqMap.isEmpty) linkDIALCode(channelID, collectionID, linkDIALCodeReqMap)
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import org.sunbird.graph.OntologyEngineContext
import org.sunbird.telemetry.logger.TelemetryManager

import java.util
import scala.collection.JavaConverters._
import java.text.MessageFormat
import scala.collection.immutable.Map
import scala.jdk.CollectionConverters._
import scala.concurrent.ExecutionContext


Expand Down
Loading
Loading