Skip to content

406 chore fj doc lib direct add usechainid param for chain alias #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- [fj-doc-lib-direct] add useChainId param for chain alias <https://github.com/fugerit-org/fj-doc/pull/406>

## [8.13.4] - 2025-04-25

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public static void handleOutput(VenusDirectConfig config, String outputId) {
log.info( "mkdir: result:{}, directory:{}", outputFile.getParentFile().mkdirs(), outputFile.getParentFile() );
}
try ( FileOutputStream fos = new FileOutputStream( outputFile ) ) {
config.getDocProcessConfig().fullProcess(chain.getChainId(), context, output.getHandlerId(), fos );
log.info( "generate outputId:{}, chainId:{}", outputId, chain.getChainId() );
config.getDocProcessConfig().fullProcess( chain.resolveChainId(), context, output.getHandlerId(), fos );
}
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.Setter;
import org.fugerit.java.core.function.SafeFunction;
import org.fugerit.java.core.io.FileIO;
import org.fugerit.java.core.lang.helpers.StringUtils;

import java.util.LinkedHashMap;

Expand All @@ -18,6 +19,9 @@ public class VenusDirectConfigChain {
@Getter @Setter
private String chainId;

@Getter @Setter
private String useChainId;

@Getter @Setter
private LinkedHashMap<String, Object> dataModel;

Expand All @@ -36,4 +40,8 @@ public void setupDataModel() {
}
}

public String resolveChainId() {
return StringUtils.valueWithDefault( this.getUseChainId(), this.getChainId() );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ chainList: # a template named ${chainId}.ftl must exist in 'templatePath' folde
docTitle: 'Venus Direct Extension - Test Doc'
- chainId: 'test-doc-json-data-model'
dataModelJson: 'src/test/resources/data-model/data-model-1.json' # JSON file data model
useChainId: 'test-doc'
- chainId: 'test-doc-yaml-data-model'
dataModelYaml: 'src/test/resources/data-model/data-model-1.yaml' # YAML file data model
useChainId: 'test-doc'
outputList:
- outputId: 'test-doc-html'
chainId: 'test-doc'
Expand All @@ -30,4 +32,4 @@ outputList:
- outputId: 'test-doc-yaml-data-model-md'
chainId: 'test-doc-yaml-data-model'
handlerId: 'md'
file: 'target/test-doc-json-data-model.md'
file: 'target/test-doc-yaml-data-model.md'

This file was deleted.

This file was deleted.