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

Added API for context aware config resource injection. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

niekraaijmakers
Copy link

Makes the following possible:

`@model(adaptables = {SlingHttpServletRequest.class, Resource.class}, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class SampleModel {

@via(type= ContextAwareConfigResource.class, value = "config")
@ValueMapValue
private String propertyTest;

public String getPropertyTest() {
return propertyTest;
}
}`

Use via to point to context aware config resource, to inject valuemap values.
Tested it locally and works fine with latest versions.
What do you think?

@stefanseifert
Copy link
Member

there is already an a JIRA ticket for this topic https://issues.apache.org/jira/browse/SLING-7256
the open questions is whether this integration goes in to

  • a) caconfig api/impl or
  • b) models api/impl
  • c) a separarate module

i would prefer b) or even c).

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