Skip to content

Latest commit

 

History

History
80 lines (70 loc) · 4.89 KB

collection-certificate-generator.md

File metadata and controls

80 lines (70 loc) · 4.89 KB

Collection Certificate Generator

'collection-certificate-generator' job is used to generate certificates.

Configuration variables:

VariableDefault ValuePurpose
kafka.input.topic{{env}}.generate.certificate.requestKafka topic from which messages/events are read to be processed.
kafka.output.failed.topic{{env}}.generate.certificate.failedKafka topic to which message is written when an exception occurs while processing an event.
kafka.output.audit.topic{{env}}.telemetry.rawKakfa topic to which and audit message is written to.
kafka.groupId{{env}}-certificate-generator-groupKafka input topic group Id
lms-cassandra.keyspacesunbird_coursesCassandra keyspace name
lms-cassandra.course_batch.tablecourse_batchCassandra table used to store batch details of a collection. Batch status, start date , end date , batch enrolment end date, enrolment type (open/invite-only), certificate templates etc are stored in this table.
lms-cassandra.user_enrolments.tableuser_enrolmentsCassandra table used to store user enrolment data in a collection of a particular batch. This also holds the consumption progress, enrolment status and issued certificate details
lms-cassandra.sbkeyspacesunbirdSunbird Keyspace
lms-cassandra.certreg.tablecert_registryCassandra table used to store user certificates (old format)
task.rc.badcharlist\x00,\\aaa,\aaa,Ø,Ý
service.content.basePathContent service URL
service.learner.basePathUser-Org service URL
service.enc.basePathEncryption service base path
service.rc.basePathSunbird RC base path
service.rc.entityTrainingCertificatevariable used to specify sunbird RC API endpoint for certificate
enable.rc.certificatetruevariable used to enable RC certificate generation
enable.suppress.exceptiontrueVariable used to suppress exception if the signatory list is empty
cloud_storage_base_urlvariable to identify the cloud storage base url. Used to replace the base url with variable mentioned in cloud_store_base_path_placeholder while storing to databases
cloud_store_base_path_placeholderCLOUD_BASE_PATHrelative variable used to replace cloud storage base urls and stored in database
content_cloud_storage_containercloud storage container name
cloud_storage_cname_urlvariable used to replace 'cloud_store_base_path_placeholder' value with cname or cloud storage url while reading data from database.

Sample event:

{
  "eid": "BE_JOB_REQUEST",
  "ets": 1563788371969,
  "mid": "LMS.1563788371969.590c5fa0-0ce8-46ed-bf6c-681c0a1fdac8",
  "actor": {
    "type": "System",
    "id": "Certificate Generator"
  },
  "context": {
    "pdata": {
      "ver": "1.0",
      "id": "org.sunbird.platform"
    }
  },
  "object": {
    "type": "GenerateCertificate",
    "id": "874ed8a5-782e-4f6c-8f36-e0288455901e"
  },
  "edata": {
    "userId": "user001",
    "svgTemplate": "https://ntpstagingall.blob.core.windows.net/user/cert/File-01311849840255795242.svg",
    "templateId": "template_01_dev_001",
    "courseName": "new course may23",
    "data": [
      {
        "recipientName": "Creation ",
        "recipientId": "user001"
      }
    ],
    "name": "100PercentCompletionCertificate",
    "tag": "0125450863553740809",
    "issuer": {
      "name": "Gujarat Council of Educational Research and Training",
      "url": "https://gcert.gujarat.gov.in/gcert/",
      "publicKey": [
        "1",
        "2"
      ]
    },
    "signatoryList": [
      {
        "name": "CEO Gujarat",
        "id": "CEO",
        "designation": "CEO",
        "image": "https://cdn.pixabay.com/photo/2014/11/09/08/06/signature-523237__340.jpg"
      }
    ],
    "criteria": {
      "narrative": "course completion certificate"
    },
    "basePath": "https://dev.sunbirded.org/certs",
    "related": {
      "type": "course",
      "batchId": "0131000245281587206",
      "courseId": "do_11309999837886054415"
    }
  }
}

Source code:

{% embed url="https://github.com/Sunbird-Lern/data-pipeline/tree/release-5.3.0/lms-jobs/credential-generator/collection-certificate-generator" %}