You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2024/05/16 13:10:51 UTC
(streampipes) branch fix-documentation-asset-overview created (now 5c2e0fae76)
This is an automated email from the ASF dual-hosted git repository.
bossenti pushed a change to branch fix-documentation-asset-overview
in repository https://gitbox.apache.org/repos/asf/streampipes.git
at 5c2e0fae76 fix: correctly retrieve documentation for asset overview
This branch includes the following new commits:
new 5c2e0fae76 fix: correctly retrieve documentation for asset overview
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(streampipes) 01/01: fix: correctly retrieve documentation for asset overview
Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bossenti pushed a commit to branch fix-documentation-asset-overview
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 5c2e0fae761d414851d079b52e95c9a66fbff502
Author: bossenti <bo...@posteo.de>
AuthorDate: Thu May 16 10:32:33 2024 +0200
fix: correctly retrieve documentation for asset overview
---
.../streampipes/rest/impl/PipelineElementAsset.java | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementAsset.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementAsset.java
index f0d628d7f9..db450ba44b 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementAsset.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementAsset.java
@@ -20,6 +20,7 @@ package org.apache.streampipes.rest.impl;
import org.apache.streampipes.manager.assets.AssetManager;
import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.storage.management.StorageDispatcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
@@ -49,6 +50,20 @@ public class PipelineElementAsset extends AbstractRestResource {
@GetMapping(path = "/{appId}/assets/documentation", produces = MediaType.TEXT_PLAIN_VALUE)
public ResponseEntity<?> getDocumentationAsset(@PathVariable("appId") String appId) {
try {
+ //If the provided appId contains "sp:spdatastream",
+ //it indicates usage by the asset-overview view where the data stream ID is supplied.
+ //In such cases, the appId of the adapter description needs retrieval for successful documentation loading.
+ if (appId.contains("sp:spdatastream")) {
+ var dataStream = StorageDispatcher.INSTANCE
+ .getNoSqlStore()
+ .getDataStreamStorage()
+ .getDataStreamByAppId(appId);
+ var adapterDescription = StorageDispatcher.INSTANCE
+ .getNoSqlStore()
+ .getAdapterInstanceStorage()
+ .getAdapter(dataStream.getCorrespondingAdapterId());
+ appId = adapterDescription.getAppId();
+ }
return ok(AssetManager.getAssetDocumentation(appId));
} catch (IOException e) {
return fail();