Hello,
I'm developing a macro plugin and need to retrieve pages (via the REST API) that contains my macro and the macro's content too.
My plan was to tag the pages with a content property from the macro when it is present in a page and later find those pages using CQL.
I was able to create content properties via the REST API and find those pages too.
However, I just find out that properties set by a macro are not visible to the REST API :(
Please, could you suggest a way to do what I need to?
Thank you!
Hi,
Have you considered adding a label to the page when your macro is rendered? You should be able to grab all the pages with this specific label via a rest call.
Hi Christo, I was afraid that people would remove the label but now that you mentioned I think it might work.
The macro render will get executed right after if the label is removed so it could almost guarantee that the label will be added back.
Unless the label is removed via REST but I think is good enough for what I need.
Thanks! I will let you know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is possible that someone could remove the label from the page, but it will be added back the next time your macro renders, which will happen each time the page is visited or refreshed.
Instead of making it seem like magic to the user you could listen for the event that removes the label and display a message to the user explaining that some functionality relies on the label and prevent its removal.
This won't prevent an admin using a app like ScriptRunner to remove or rename all the labels on all the pages though. So I think it will depend on how critical the functionality you are trying to implement is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will rely on labels until something more safe come out.
Thanks for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.