plugins/nexus-coreui-plugin/src/main/resources/static/rapture/NX/coreui/view/browse/ComponentAssetTree.js
plugins/nexus-coreui-plugin/src/main/resources/static/rapture/NX/coreui/model/ComponentAssetTree.js
plugins/nexus-coreui-plugin/src/main/resources/static/rapture/NX/coreui/controller/ComponentAssetTree.js
plugins/nexus-coreui-plugin/src/main/resources/static/rapture/NX/coreui/store/ComponentAssetTree.js
1 2 3 4 5 6 7 8 9 10 11 12
| proxy: { type: 'direct', api: { read: 'NX.direct.coreui_Browse.read' },
reader: { type: 'json', rootProperty: 'data', successProperty: 'success' } },
|
plugins/nexus-coreui-plugin/src/main/java/org/sonatype/nexus/coreui/BrowseComponent.groovy
1 2 3 4 5 6
| @Named @Singleton @DirectAction(action = 'coreui_Browse') class BrowseComponent extends DirectComponentSupport {
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
@DirectMethod @Timed @ExceptionMetered List<BrowseNodeXO> read(TreeStoreLoadParameters treeStoreLoadParameters) { String repositoryName = treeStoreLoadParameters.repositoryName String path = treeStoreLoadParameters.node
Repository repository = repositoryManager.get(repositoryName)
List<String> pathSegments if (isRoot(path)) { pathSegments = Collections.emptyList() } else { pathSegments = path.split('/').collect { String part -> EncodingUtil.urlDecode(part) } }
return browseNodeQueryService.getByPath(repository, pathSegments, configuration.maxNodes) .collect { BrowseNode browseNode -> def encodedPath = EncodingUtil.urlEncode(browseNode.name) def type = browseNode.assetId != null ? ASSET : browseNode.componentId != null ? COMPONENT : FOLDER new BrowseNodeXO( id: isRoot(path) ? encodedPath : (path + '/' + encodedPath), type: type, text: browseNode.name, leaf: browseNode.leaf, componentId: browseNode.componentId?.value, assetId: browseNode.assetId?.value, packageUrl: browseNode.packageUrl ) } }
|
1 2 3 4 5 6
| BrowseNode{repositoryName=maven-releases, format=maven2, parentPath=/, name=nexus, path=nexus/, leaf=false, componentId='null', assetId='null'} BrowseNode{repositoryName=maven-releases, format=maven2, parentPath=/nexus/, name=20230318_060159_nexus_dev_3.43.0, path=nexus/20230318_060159_nexus_dev_3.43.0/, leaf=false, componentId='null', assetId='null'} BrowseNode{repositoryName=maven-releases, format=maven2, parentPath=/nexus/, name=20230320_101553_nexus_dev_3.43.0, path=nexus/20230320_101553_nexus_dev_3.43.0/, leaf=false, componentId='null', assetId='null'} BrowseNode{repositoryName=maven-releases, format=maven2, parentPath=/nexus/, name=20230321_060159_nexus_dev_3.43.0, path=nexus/20230321_060159_nexus_dev_3.43.0/, leaf=false, componentId='null', assetId='null'}
|