Skip to content

Commit

Permalink
Cbrelease 4.8.9 (#139)
Browse files Browse the repository at this point in the history
* Moved content hierarchy from contant to configuration property

* formatted code
  • Loading branch information
ravisaurav-tarento authored Dec 22, 2023
1 parent f5f9390 commit 0b0b452
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/sunbird/workflow/config/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ public class Configuration {
@Value("${domain.validation.regex}")
private String domainValidationRegex;

@Value("${env.hierarchy.keystore.keyspace}")
private String envHierarchyKeystoreKeyspaceName;

public String getModificationRecordAllowActions() {
return modificationRecordAllowActions;
}
Expand Down Expand Up @@ -683,4 +686,12 @@ public String getDomainValidationRegex() {
public void setDomainValidationRegex(String domainValidationRegex) {
this.domainValidationRegex = domainValidationRegex;
}

public String getEnvHierarchyKeystoreKeyspaceName() {
return envHierarchyKeystoreKeyspaceName;
}

public void setEnvHierarchyKeystoreKeyspaceName(String envHierarchyKeystoreKeyspaceName) {
this.envHierarchyKeystoreKeyspaceName = envHierarchyKeystoreKeyspaceName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;
import org.sunbird.workflow.config.Configuration;
import org.sunbird.workflow.config.Constants;
import org.sunbird.workflow.models.WfRequest;
import org.sunbird.workflow.service.impl.NotificationServiceImpl;
Expand All @@ -33,6 +34,9 @@ public class NotificationConsumer {
@Autowired
private CassandraOperation cassandraOperation;

@Autowired
private Configuration configuration;

@KafkaListener(groupId = "workflowNotificationTopic-consumer", topics = "${kafka.topics.workflow.notification}")
public void processMessage(ConsumerRecord<String, String> data) {
WfRequest wfRequest = null;
Expand Down Expand Up @@ -76,7 +80,7 @@ public Map<String, Object> getCourseAttributes(String courseId){
Map<String, Object> propertiesMap = new HashMap<>();
Map<String, Object> courseDetails = new HashMap<>();
propertiesMap.put(Constants.IDENTIFIER, courseId);
List<Map<String, Object>> coursesDataList = cassandraOperation.getRecordsByProperties(Constants.DEV_HIERARCHY_STORE,
List<Map<String, Object>> coursesDataList = cassandraOperation.getRecordsByProperties(configuration.getEnvHierarchyKeystoreKeyspaceName(),
Constants.CONTENT_HIERARCHY,
propertiesMap,
Arrays.asList(Constants.IDENTIFIER, Constants.HIERARCHY));
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ bp.approval.request.mail.body=You have received a request for enrollment for #us
bp.request.forwarded.mail.body=The enrollment request for #username in #batch_name of the #blended_programme_name Program, starting on #batch_start_date , has been forwarded to the #role for approval.
bp.nomination.request.mail.body=The enrollment request for #username in #batch_name of the #blended_programme_name Program, starting on #batch_start_date , has been #state.

domain.validation.regex=^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$
domain.validation.regex=^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$
env.hierarchy.keystore.keyspace=dev_hierarchy_store

0 comments on commit 0b0b452

Please sign in to comment.