Skip to content
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

Pass print stream to binding providers #81

Conversation

gruberrolandvaltech
Copy link
Contributor

This allows binding providers to access the print stream. This is required to output messages to output text.
This is an incompatible API change which should be fine. The latest changes to binding interface also included an incompatible change.

@gruberrolandvaltech
Copy link
Contributor Author

@lykorian Happy new year! :) Is the code fine for you or do you see room for improvement?

@markdaugherty
Copy link
Collaborator

Can you give an example of how this change would be used?

feature/binding_outputStream

Conflicts:
	src/main/groovy/com/icfolson/aem/groovy/console/api/BindingExtensionProvider.groovy
	src/main/groovy/com/icfolson/aem/groovy/console/components/BindingsPanel.groovy
	src/main/groovy/com/icfolson/aem/groovy/console/extension/impl/DefaultBindingExtensionProvider.groovy
	src/main/groovy/com/icfolson/aem/groovy/console/extension/impl/DefaultExtensionService.groovy
	src/main/groovy/com/icfolson/aem/groovy/console/impl/DefaultGroovyConsoleService.groovy
	src/test/groovy/com/icfolson/aem/groovy/console/extension/impl/DefaultExtensionServiceSpec.groovy
@gruberrolandvaltech
Copy link
Contributor Author

In our binding we need to print to the output stream so data gets into the response of the script. Currently, we do this by returning a string and using "println" inside script.

Simple example:

println aecu.contentUpgradeBuilder()
.forResources((String[]) ["/content/we-retail/ca/en"])
.printPath()
.run()

But this is bad and hard to understand for users. So we would like to get rid of the "println" at the beginning. For this our binding needs access to the print stream.
I think there is no other possibility right now to write to the run's output area.

@markdaugherty
Copy link
Collaborator

OK, that makes sense. I'm going to roll this in with a couple other API changes for the next release. Will have it completed in the next few days. Thanks for the suggestion!

@gruberrolandvaltech
Copy link
Contributor Author

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants