ConfigurationAdmin – Access OSGi configuration of other services


In this article we will explore ConfigurationAdmin interface. Service for administering configuration data. ConfigurationAdmin is a dictionary of properties. To identify a target service's dictionary use its PID. Sharing as code snippet that reads "rootmapping.target" configuration of the OOTB "Day CQ Root Mapping" service. https://gist.github.com/aanchalsikka/dd0bfd893eaf4492ef3453b7b723d45a When a target service's configuration is updated, config details would … Continue reading ConfigurationAdmin – Access OSGi configuration of other services

Code snippets – XML Add-On


Document State transitions Get allowed Document State transitions for an asset.The API will return next allowed document state transitions for the user identified by userID attribute JSONObject jsonResponse = ProfileService.getdocstateinfo(new String[] { assetPath }, userID, resourceResolver); LOG.debug("Profile service response: {} for asset: {}", jsonResponse, assetPath); JSONArray jsonArray = jsonResponse.getJSONObject(assetPath).getJSONArray(DOCSTATEJSON_ALLOWEDSTATES_KEY); for (int i = 0; i … Continue reading Code snippets – XML Add-On

API – Fetch all DITA Map dependencies


Sharing a code snippet that would help you retrieve all dependencies of a DITAMAP. This includes: DITA Map itselfAssociated TopicsAssets used in Topics like Images In particular, following is the snippet fetching all dependencies List<Node> mapDependents = MapUtilities.getAllDependencies(ditamapNode); mapDependents.forEach(associatedAsset -> { //associatedAsset is object representing DITA-Map/Topics/Images }); Sharing a Servlet that retrieves all dependencies and … Continue reading API – Fetch all DITA Map dependencies