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

"Parent" similar from PrettyFaces #250

Open
lriquelme opened this issue Aug 22, 2017 · 2 comments
Open

"Parent" similar from PrettyFaces #250

lriquelme opened this issue Aug 22, 2017 · 2 comments

Comments

@lriquelme
Copy link

lriquelme commented Aug 22, 2017

Hi guys, what is the similar "parentId" annotation (from prettyfaces) in rewrite?

Regards

@chkal
Copy link
Member

chkal commented Aug 23, 2017

No, sorry. I don't think there is such a feature yet.

@lincolnthree
Copy link
Member

Actually, I believe the Subset rule can be used for this purpose, but you might have to do a little bit of hand-waving to get child rules to apply themselves as if they were a literal child of the "parent" segment:

https://github.com/ocpsoft/rewrite/blob/master/api/src/main/java/org/ocpsoft/rewrite/config/Subset.java

A few examples of simple Subset use-cases. However, I don't believe I have one that actually does what you want it to do:
https://github.com/ocpsoft/rewrite/blob/master/api-tests/src/test/java/org/ocpsoft/rewrite/config/SubsetParameterReconfigurationTestProvider.java
https://github.com/ocpsoft/redoculous/blob/master/app/src/main/java/org/ocpsoft/redoculous/config/PreviewModeConfigurationProvider.java

Then you'd need to create and register an annotation to handle this new functionality (if you want to make it an annotation):

https://github.com/ocpsoft/rewrite/blob/master/config-annotations/src/main/resources/META-INF/services/org.ocpsoft.rewrite.annotation.spi.AnnotationHandler

I think it's possible to do with this, but as I said above, you might need to get a bit creative. If you do figure out how to do it, please let us know! If you get to the point of needing to create an annotation, @chkal might be able to explain how to get one of those set up, in specifics.

It's also possible that simply registering an annotation to handle this that "reconfigures" the necessary @Join mappings would be enough (without subset, but I'd start with Subset if you're using the Java ConfigurationProvider API.

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

No branches or pull requests

3 participants