APIs & services / commons-report-service

List habitations under a VO. Same call duplicated in three client classes.

Endpointtoday's app
Call
GET /gateway/commons-report-service/api/v1/datasets/name/PlusOneGetAllHabitationForVOAliasId/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

Fifth level of the drill-down: lists habitations under the selected VO. In the endorsement filter the chosen habitation feeds PlusOneWorkNodeFarmerListGeoWiseNoPagination; in the lease dialog it feeds the SHG list. Errors leave the habitation 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
namequeryYesPlusOneGetAllHabitationForVOAliasIdDataset 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.
paramsqueryYesVO_ALIAS_ID=VO-ALIAS-001Dataset input parameters as KEY=value pairs joined with "--". VO_ALIAS_ID = VOAlias of the selected VO. 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. VO_ALIAS_ID

Response

Example response body (synthetic data)
[
  {
    "HabitationAlias": "H01",
    "HabitationName": "Habitation A",
    "WorkNodeHabitationOLTPId": "901"
  }
]
FieldTypeRequiredNotes
HabitationAliasstringDropdown value; sent as HABITATION_CODE or WORK_NODE_HABITATION_ALIAS.
HabitationNamestringDropdown label.
WorkNodeHabitationOLTPIdstringParsed but not read by the app.

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/landasset/AddUpdateAssetNewDialog.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/entity/voFilters/Habitat.kt