APIs & services / commons-report-service

List mandals in a district. Same call duplicated in three client classes.

Endpointtoday's app
Call
GET /gateway/commons-report-service/api/v1/datasets/name/PlusOneGetAllMandalsForDistrict/execute
Service
commons-report-service
Features
VO geographic filter (FCCC), Leased land
When
User drills down a geography filter
Auth
X-SESSIONID set by CoreAPI (dooNowOrThrow)
In the App Service

Use case

Second level of the geography drill-down: after a district is picked, EndorsementFragment and AddUpdateAssetNewDialog load its mandals. VoFilterRepoImpl encodes spaces in the alias as %20; EndorsementRepositoryImpl sends it raw. Errors leave the mandal dropdown empty.

Headers

HeaderValueNotes
X-SESSIONID<session token>Added by Bridge CoreAPI from the AccountManager session when the Operation is executed with dooNowOrThrow. The app code does not set it.

Parameters

ParamInRequiredExampleNotes
namequeryYesPlusOneGetAllMandalsForDistrictDataset name. The rtld executor (/rtld/api/dataset/v1/execute) picks the dataset by this query param.
versionqueryYes1Dataset version. Always 1.
formatqueryYesjsonResponse format. Always json, so the body is a JSON array of row objects.
paramsqueryYesDISTRICT_ALIAS=D01Dataset input parameters as KEY=value pairs joined with "--". DISTRICT_ALIAS = DistrictAlias of the selected district. Note: the live code calls this on the rtld executor (GET /rtld/api/dataset/v1/execute?name=...), not the commons-report-service path in the key.

Request

No body. DISTRICT_ALIAS

Response

Example response body (synthetic data)
[
  {
    "MandalCode": "M01",
    "MandalName": "Mandal A"
  }
]
FieldTypeRequiredNotes
MandalCodestringDropdown value; sent as MANDAL_ALIAS for the village call.
MandalNamestringDropdown label.

Errors

StatusWhenWhat the app does
non-2xxServer rejects the call or the dataset query fails (CoreAPI handles session refresh internally)Resource.error with the raw response; the dropdown stays empty. In EndorsementRepositoryImpl the call runs without try/catch, so a thrown exception is not caught there. VoFilterRepoImpl catches it and shows "Something went wrong".
network errorNo connectivity or timeoutResource.error with the raw response; the dropdown stays empty. In EndorsementRepositoryImpl the call runs without try/catch, so a thrown exception is not caught there. VoFilterRepoImpl catches it and shows "Something went wrong".

Source

  • app/src/main/java/org/platformcommons/urvi/datasource/repository/impl/EndorsementRepositoryImpl.kt
  • app/src/main/java/org/platformcommons/urvi/datasource/repository/impl/VoFilterRepoImpl.kt
  • app/src/main/java/org/platformcommons/urvi/view/endorsements/vo/EndorsementFragment.kt
  • app/src/main/java/org/platformcommons/urvi/view/landasset/AddUpdateAssetNewDialog.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/entity/voFilters/Mandal.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/setup_new/SetupServiceNew.kt